Re: [gnome-db] Status of libgda's trunk
- From: "Vivien Malerba" <vmalerba gmail com>
- To: "Massimo Cora'" <maxcvs email it>
- Cc: gnome-db list <gnome-db-list gnome org>, Murray Cumming <murrayc murrayc com>
- Subject: Re: [gnome-db] Status of libgda's trunk
- Date: Tue, 18 Mar 2008 11:41:38 +0100
On Sun, Mar 16, 2008 at 4:37 PM, Massimo Cora' <maxcvs email it> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Vivien,
>
> I've found a crasher on libgda-trunk.
>
> You can reproduce that just adding a
>
> run_sql_non_select (cnc, "\n");
>
> on samples/SimpleExample/example.c inside create_table () function.
>
> backtrace
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread -1217751360 (LWP 29102)]
> 0xb7f13838 in sqlite3_clear_bindings (pStmt=0x0) at sqlite3.c:37988
> 37988 sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
> (gdb) bt
> #0 0xb7f13838 in sqlite3_clear_bindings (pStmt=0x0) at sqlite3.c:37988
> #1 0xb7ef9bb8 in gda_sqlite_provider_statement_execute
> (provider=0x8080f60,
> cnc=0x80c67c0, stmt=0x80b4ac0, params=0x0,
> model_usage=GDA_STATEMENT_MODEL_RANDOM_ACCESS, col_types=0x80b44e8,
> last_inserted_row=0x0, task_id=0x0, async_cb=0, cb_data=0x0,
> error=0xbfbb3478) at gda-sqlite-provider.c:1600
> #2 0xb7e9a449 in gda_connection_statement_execute_v (cnc=0x80c67c0,
> stmt=0x80b4ac0, params=0x0,
> model_usage=GDA_STATEMENT_MODEL_RANDOM_ACCESS,
> last_inserted_row=0x0, error=0xbfbb3478) at gda-connection.c:1210
> #3 0xb7e9d773 in gda_connection_statement_execute_non_select
> (cnc=0x80c67c0,
> stmt=0x80b4ac0, params=0x0, last_insert_row=0x0, error=0xbfbb3478)
> at gda-connection.c:1309
> #4 0x08048bd3 in run_sql_non_select (cnc=0x80c67c0, sql=0x8048d97 "\n")
> at example.c:112
> #5 0x08048a1f in create_table (cnc=0x80c67c0) at example.c:60
> #6 0x0804891f in main (argc=135012808, argv=0x1) at example.c:18
>
> I've found this while recursively calling run_sql_non_select () to parse
> a table.sql file, where there are instructions to many 'create table
> functions'.
It seems SQLite does not work correctly when the prepared statement is
NULL (it makes it crash). However normally the parser includes leading
and trailing newlines into the current statement, so you should not
have any problem. For example parsing the
"stmt1\n;\n\nstmt2;\nstmt3\n" should create 3 statements only. Of
course you can always use gda_statement_is_useless() to tell
if a statement is useless.
Anyway, the correction will be in SVN ASAP.
Cheers,
Vivien
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]