Bug #75624 Escape function for AGAINST() queries
Submitted: 25 Jan 2015 16:51 Modified: 26 Jan 2015 10:11
Reporter: Kalle Nielsen Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: C API (client library) Severity:S4 (Feature request)
Version:5.6 OS:Any
Assigned to: CPU Architecture:Any

[25 Jan 2015 16:51] Kalle Nielsen
I would like to request a function to escape queries that is used in FULLTEXT searches, currently (from a PHP backend):

$sql = '... AGAINST(\'+' . $input . '\') ...';

If $input have a void value like: $input = '--'; then the query would end up looking like:

... AGAINST('+--') ...

Which is a syntax error, ofcourse. So I would like to request a C function to handle such escape sequences much like the escape string API that is exposed to client libraries used for language bindings.

How to repeat:
[26 Jan 2015 10:11] MySQL Verification Team
Thank you for the bug report (feature request)