DDL statements return result other than 0
What steps will reproduce the problem? 1.First, establish a connection and execute sth like:
stat.executeUpdate("insert into people values ('blah', 'someone');");
stat.executeUpdate("drop table if exists people;");
What is the expected output? What do you see instead?
If you printout result returned by last statement, it is 1 instead of 0. This happens because executeUpdate returns changes = db.changes() without checking whether it is a DDL statement or not. In this case, it's 1, the result from INSERT statement.
What version of the product are you using? On what operating system?
I'm using 3.7.8-snapshot on Mac.
Please provide any additional information below.
In Stmt.executeUpdate(String sql) line: 157
changes = db.changes();
here native method NativeDB.changes() calling for C function int sqlite3_changes(sqlite3*);, which " returns the number of changes in the most recent INSERT, UPDATE, or DELETE that also occurred at the top level. "
Many thanks for your great work,