Issue 21482

Summary: [parser] MySQL driver should recognise "regexp" keyword
Product: Base Reporter: ingenstans
Component: codeAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P4 CC: issues
Version: OOo 1.1 RC5Keywords: needhelp
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Latest Confirmation in: ---
Developer Difficulty: ---

Description ingenstans 2003-10-21 03:02:53 UTC
MySQL has a very useful "regexp" keyword, which lets you write things like 
'SELECT headline FROM articles WHERE bodytext REGEXP "weapons .* destruction" '

However, queries of this sort are not currently allowed by the OOo MySQL driver, 
and can't be used in forms (they can be typed in as raw SQL).

The enhancement I propose is to allow the driver to accept these queries. 
Ideally, they should be parameterisable too. so that we could write and store 
queries like "SELECT headline FROM articles WHERE Bodytext regexp :x"
Comment 1 Frank Schönheit 2003-10-21 08:52:47 UTC
Due to your last paragraph, I assume that using REGEXP together with
parameters is the real intention here :). One way would be what you
suggested - enhance the parser, so that it recognizes this keyword.
However, enhancing the parser with keywords which are too
database-specific should be done very carefully only.
The other possible solution would be to allow parameters for "native"
queries, too. At the moment, the parameter information is obtained by
our SQL parser, so if a statement is not parseable, there are no
parameters. We could alternatively allow the user to declare a number
of parameters even for native statements where we cannot find the
parameters ourself ...
Comment 2 Frank Schönheit 2003-10-23 08:42:30 UTC
fs->oj: if somebody is every to implement this, then most probably you :)
Comment 3 hans_werner67 2004-02-02 12:17:59 UTC
change subcomponent to 'none'