Hi everyone,

I found a reproducible bug on the SQL UPDATE statement parsing. Here is the
details.

I 've try to update some data on a SQLite database with a outlandish syntax
with "AND" between the columns to be update.  The SQL didn't fail but the
data update was incomplete.


The SQLite version :

$ sqlite3 -version
3.13.0 2016-05-18 10:57:30 fc49f556e48970561d7ab6a2f24fdd7d9eb81ff2


The data base schema :

$ sqlite3 test.db ".schema"
CREATE TABLE test(id interger, name varchar, age integer)


The initial stat of the table :

$ sqlite3 test.db "SELECT * FROM test;"
1|toto|10
2|tita|10
2|tita|10
1|toto|10
2|tita|10


The oulandish SQL UPDATE :

$ sqlite3 test.db "UPDATE test SET id=0 AND name='new_name' AND age=30
WHERE id=1;"


The stat of the table after the outlandish update :

$ sqlite3 test.db "SELECT * FROM test;"
0|toto|10
2|tita|10
2|tita|10
0|toto|10
2|tita|10

==> The "id" column was updated but not the two other columns "name" and
"age".


A common SQL Update syntaxe work perfectly :

$ sqlite3 test.db "UPDATE test SET id=6, name='new_name', age=30 WHERE
id=2;"

$ sqlite3 test.db "SELECT * FROM test;"
0|toto|10
6|new_name|30
6|new_name|30
0|toto|10
6|new_name|30


Good Luck

der.nairolf
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to