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 74404 - Semicolon causes SQL Window in Gnome-DB to Crash
Semicolon causes SQL Window in Gnome-DB to Crash
Status: VERIFIED FIXED
Product: libgda
Classification: Other
Component: PostgreSQL provider
0.8.x
Other Linux
: Normal normal
: ---
Assigned To: Rodrigo Moya
Rodrigo Moya
Depends on:
Blocks:
 
 
Reported: 2002-03-12 19:33 UTC by danmorg
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Contains debug info from gdb and backtrace (5.66 KB, text/plain)
2002-03-12 19:37 UTC, danmorg
  Details
Solves the problem (642 bytes, patch)
2002-03-29 03:11 UTC, Gonzalo Paniagua Javier
none Details | Review

Description danmorg 2002-03-12 19:33:38 UTC
When executing a query in the SQL Window witin Gnome-DB, and the query
contains a semi-colon at the end; GNOME-DB or one of its components will
have a segmentation fault.

-- this query will cause an Error: 1873834392
-- do it again, and it will crash.
-- this will consistently happen too
select * from sometable;

-- this query works
select *
from table

i will attach the backtrace later...
Comment 1 danmorg 2002-03-12 19:37:02 UTC
Created attachment 7126 [details]
Contains debug info from gdb and backtrace
Comment 2 danmorg 2002-03-12 21:20:07 UTC
These two select sql statements will cause the SQL Window to crash as
well:

select 'one' from sometable

select 'two' from sometable

Notice, i did not have semicolons this time.  'sometable' is just some
arbitrary user table.  The actual table I had was very simple: two
varchar columns, and it had two rows of little data in it.

In Gnome-db 0.2.9x, this would execute all the sql statements, but
only the last sql statement's result set would show up in the sql_grid.
Comment 3 danmorg 2002-03-12 21:28:47 UTC
oops.  Let me clarify.  

In Gnomedb-fe 0.2.9x, the two queries in a row without a semicolon
would have produced a SQL error.  What I meant to say:

SELECT 'ONE' FROM SOMETABLE;

SELECT 'TWO' FROM SOMETABLE;

This will execute both queries but the only the result set for the
second query will show up in the sql_grid.
Comment 4 danmorg 2002-03-14 00:52:21 UTC
Appears to be two problems here:

1. handling of the result from g_strsplit in splitting of SQL Command
strings.  This is in function process_sql_commands of the postgres
provider.

2. error handling - any SQL error will cause a segmentation fault in
the error handling of possibly libgda or the postgres provider
Comment 5 Gonzalo Paniagua Javier 2002-03-29 03:11:50 UTC
Created attachment 7431 [details] [review]
Solves the problem