Bug #5559 Full-text search for exact phrase parsing error
Submitted: 14 Sep 2004 7:02 Modified: 28 Sep 2004 9:47
Reporter: Michele Taverna Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:1.0.0 beta OS:Windows (Windows XP)
Assigned to: Reggie Burnett CPU Architecture:Any

[14 Sep 2004 7:02] Michele Taverna
Description:
Following error occurs trying to execute a command which include MATCH..AGAINST for exact phrase full-text search including a MySqlParameter:

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '?d_linguaggio_id)' at line 1

Notice that subsituting the MySqlParameter with the corresponding value, no errors are returned. Only exact phrase search procude errors, while other searches without double quotes (") are correclty executed.

How to repeat:
SQL STRING THAT RETURN AN ERROR:

"SELECT COUNT(DISTINCT t_articolo.t_articolo_pk) FROM t_articolo,t_autore ,r_articolo_linguaggio WHERE MATCH(titolo,abstract_html,testo_html) AGAINST ('\"server pattern\"' IN BOOLEAN MODE) AND (t_articolo.t_autore_fk=t_autore.t_autore_pk) AND (t_articolo.t_articolo_pk=r_articolo_linguaggio.t_articolo_pk) AND (d_linguaggio_id=?d_linguaggio_id) ;"

SAME SQL STRING THAT NOT RETURN ANY ERROR (WITHOUT PARAMETERS):

"SELECT COUNT(DISTINCT t_articolo.t_articolo_pk) FROM t_articolo,t_autore ,r_articolo_linguaggio WHERE MATCH(titolo,abstract_html,testo_html) AGAINST ('\"server pattern\"' IN BOOLEAN MODE) AND (t_articolo.t_autore_fk=t_autore.t_autore_pk) AND (t_articolo.t_articolo_pk=r_articolo_linguaggio.t_articolo_pk) AND (d_linguaggio_id=8) ;"

NOTE: Strings are in C# format.

Suggested fix:
It seems to be a parser error due to double quotes.
[28 Sep 2004 9:47] Reggie Burnett
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

This is a duplicate of a previously submitted bug.