Apache OpenOffice (AOO) Bugzilla – Issue 21482
[parser] MySQL driver should recognise "regexp" keyword
Last modified: 2013-08-07 15:45:41 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"
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 ...
fs->oj: if somebody is every to implement this, then most probably you :)
change subcomponent to 'none'