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 131040 - can't handle queries that include ';'
can't handle queries that include ';'
Status: RESOLVED FIXED
Product: libgda
Classification: Other
Component: PostgreSQL provider
1.0.x
Other Linux
: Normal normal
: ---
Assigned To: malerba
gnome-db Maintainers
: 326325 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-01-09 21:46 UTC by Jon Willeke
Modified: 2006-05-12 16:28 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jon Willeke 2004-01-09 21:46:39 UTC
I'm using the following: libgda 1.0.2, Python 2.3.3, PyGTK 2.0.0, and
PostgreSQL 7.3.2.

A query that includes a semi-colon in a quoted string does not return any
results with the PostgreSQL provider, even with the
execute_single_command() method; e.g.,

  select bar from jcw.foo where qux <> ';'

This problem does not occur with ODBC provider.

I got similar results with MySQL 3.23.55.
Comment 1 malerba 2006-05-10 10:00:16 UTC
*** Bug 326325 has been marked as a duplicate of this bug. ***
Comment 2 malerba 2006-05-10 15:38:07 UTC
The reason is that providers use a simple cut-at-the-semi-columns algorithm to separate the statements from within a single string, which is obviously wrong in cases like the one mentionned.

I'm working on a better way of splitting strings to identify all the statements.
Comment 3 Murray Cumming 2006-05-10 16:12:34 UTC
So, I guess this is NOTABUG because we should be escaping the ; in strings. I think I do that in Glom already. I think there's libgda API for escaping strings now too.

Presumably, when we can build libgda queries without SQL then it will automatically escape string values. 
Comment 4 malerba 2006-05-10 16:22:31 UTC
Not really because providers are expected to handle SQL commands which are composed of several SQL statements separated by a semi-column, and run each SQL statement one after the other. It's that splitting of individual SQL statements which is broken at this time.
Comment 5 malerba 2006-05-12 16:28:26 UTC
Commited a correction to CVS. Closing that bug.