GNOME Bugzilla – Bug 337334
gda_connection_execute_* reports an error, if a semicolon is in a value
Last modified: 2006-08-02 22:48:12 UTC
Please describe the problem: If a semicolon is inside a field that is queried (for example ... a = 'asdf;'), the all gda_connection_execute_-commands report an error and the command is not executed, although it is a valid sql string. Steps to reproduce: run: daCommand * db_command = gda_command_new ( "select * from mydb where myval = 'asdf;', GDA_COMMAND_TYPE_SQL, GDA_COMMAND_OPTION_STOP_ON_ERRORS); gda_connection_execute_non_query(connection, db_command, NULL); Actual results: The command is not run. the error is 1064: 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 ''' at line 1 It failed also in SQLite so I think it is a general problem. Expected results: The command is executed. Does this happen every time? yes Other information: Is there perhaps any workaround to escape the semicolon? I didn't find one.
I have this as well
Actually it's a duplicate of a fixed bug. Please upgrade to get it fixed: 2004-04-15 Benjamin Otte <in7y118@public.uni-hamburg.de> Fixes #140113 * providers/sqlite/gda-sqlite-provider.c (sql_split): new function to correctly split multiple SQL commands. (process_sql_commands): use the new function instead of g_strsplit. *** This bug has been marked as a duplicate of 140113 ***