Fix the xfer optimization for WITHOUT ROWID tables so that it correctly

updates the change count returned by sqlite3_changes().

FossilOrigin-Name: eff43715d1a3a9ce3fe5da194dbb76ec0c06e13c
This commit is contained in:
drh
2015-07-28 18:53:37 +00:00
parent 33a3c75999
commit 41b9ca2519
4 changed files with 30 additions and 11 deletions
+16
View File
@@ -2081,4 +2081,20 @@ do_test without_rowid3-ce7c13.1.6 {
}
} {1 {FOREIGN KEY constraint failed}}
# Confirm that changes() works on WITHOUT ROWID tables that use the
# xfer optimization.
#
db close
sqlite3 db :memory:
do_execsql_test without_rowid3-30.1 {
CREATE TABLE t1(a,b,PRIMARY KEY(a,b)) WITHOUT ROWID;
CREATE TABLE t2(a,b,PRIMARY KEY(a,b)) WITHOUT ROWID;
INSERT INTO t1 VALUES(1,2),(3,4),(5,6);
SELECT changes();
} {3}
do_execsql_test without_rowid3-30.2 {
INSERT INTO t2 SELECT * FROM t1;
SELECT changes();
} {3}
finish_test