Bugs item #1577810, was opened at 2006-10-15 23:51
Message generated for change (Comment added) made by mhoenicka
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=512945&aid=1577810&group_id=65979

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Peter MacDonald (pcmacdon)
Assigned to: Nobody/Anonymous (nobody)
Summary: sqlite table types bug.

Initial Comment:
Tiny patch to fix bug where types of fields not
found for trailing semicolon:

   'select * from tbl;'

The trailing ; is required by mysql and other sql's.
Basically this is just:

-    while (*item && *item != ' ' && *item != ',') {
+    while (*item && (!isspace(*item)) && *item != ','
&& *item != ';') {

It should be applied to both sqlite.c and sqlite3.c

----------------------------------------------------------------------

>Comment By: Markus Hoenicka (mhoenicka)
Date: 2006-10-17 12:46

Message:
Logged In: YES 
user_id=85809

I'll add the semicolon detection to make sure we also catch
the odd case. In general there is no need to add a trailing
semicolon to the queries that you send through libdbi or one
of the database engine APIs. E.g. tests/test_dbi.c runs a
boatload of queries without using a single semicolon. These
queries work ok for all supported database engines.

The trailing semicolon has two purposes:

- in most command line clients, the semicolon marks the end
of a query string. This is not required when sending a C
string to the dbi_conn_query() function or similar database
API functions as the end of the string sufficiently marks
the end of the query.

- some database engines (e.g. PostgreSQL, SQLite, but not
MySQL) allow to send a query string containing several
queries separated by semicolons. These queries run in a
single transaction. This is nice for interactive use, but
you do not want to use this in an application as the return
code of the query indicates only the result of the last
query. Instead, you'd manually start a transaction and run
each query individually, followed by the proper error handling.

So, in general there should be no trailing semicolons in
queries sent through the libdbi API.


----------------------------------------------------------------------

Comment By: Peter MacDonald (pcmacdon)
Date: 2006-10-17 01:54

Message:
Logged In: YES 
user_id=190660

The problem description doesn't say it, but
issue that is being fixed is dbi_conn_get_table_list()
reporting there are no field types because it
can't parse the table description in sqlite_master.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=512945&aid=1577810&group_id=65979

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Libdbi-drivers-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libdbi-drivers-devel

Reply via email to