1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Fix a bug in the sqlite3_changes() function reported on the mailing list. (CVS 3868)

FossilOrigin-Name: 58ea768c3e9905bd9db137f1b31dd3dd6c6001d0
This commit is contained in:
drh
2007-04-25 11:28:16 +00:00
parent 1831f18c84
commit e0e11e2df6
4 changed files with 20 additions and 14 deletions

View File

@ -50,8 +50,19 @@ do_test laststmtchanges-1.2 {
}
} {0 {5 13}}
# There was some goofy change-counting logic in sqlite3_exec() that
# appears to have been left over from SQLite version 2. This test
# makes sure it has been removed.
#
do_test laststmtchanges-1.2.1 {
db cache flush
sqlite3_exec_printf db {update t0 set x=4 where x=3; select 1;} {}
execsql {select changes()}
} {5}
# changes() unchanged within an update statement
do_test laststmtchanges-1.3 {
execsql {update t0 set x=3 where x=4}
catchsql {
update t0 set x=x+changes() where x=3;
select count() from t0 where x=8;