After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 337334 - gda_connection_execute_* reports an error, if a semicolon is in a value
gda_connection_execute_* reports an error, if a semicolon is in a value
Status: RESOLVED DUPLICATE of bug 140113
Product: libgda
Classification: Other
Component: general
1.2.x
Other All
: Normal major
: ---
Assigned To: Rodrigo Moya
gnome-db Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-04-05 10:15 UTC by Ralf Dragon
Modified: 2006-08-02 22:48 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ralf Dragon 2006-04-05 10:15:40 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.
Comment 1 Nickolay V. Shmyrev 2006-08-02 06:45:26 UTC
I have this as well
Comment 2 Nickolay V. Shmyrev 2006-08-02 22:48:12 UTC
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 ***