Fix a register allocation problem in PRAGMA integrity_check that caused

the same register to be used for two different purposes on the first
ATTACHed database if the schema for the ATTACHed database was noticable
more complex than the schema for the first database.
Fix for ticket [a4e06e75a9ab61a1].

FossilOrigin-Name: 253945d480b052bfe311888022b5eb0be91c8c80cda05036e58207d57520262c
This commit is contained in:
drh
2017-07-15 20:33:19 +00:00
parent e7c6f97b1d
commit 3963e584b4
5 changed files with 28 additions and 11 deletions
+16
View File
@@ -870,5 +870,21 @@ do_execsql_test attach-11.1 {
SELECT * FROM aux1.t1;
} {1 2 3 4}
# Ticket https://sqlite.org/src/tktview/a4e06e75a9ab61a1 2017-07-15
# False positive when running integrity_check on a connection with
# attached databases.
#
db close
sqlite3 db :memory:
do_execsql_test attach-12.1 {
CREATE TABLE Table1 (col TEXT NOT NULL PRIMARY KEY);
ATTACH ':memory:' AS db2;
CREATE TABLE db2.Table2(col1 INTEGER, col2 INTEGER, col3 INTEGER, col4);
CREATE UNIQUE INDEX db2.idx_col1_unique ON Table2 (col1);
CREATE UNIQUE INDEX db2.idx_col23_unique ON Table2 (col2, col3);
CREATE INDEX db2.idx_col2 ON Table2 (col2);
INSERT INTO Table2 VALUES(1,2,3,4);
PRAGMA integrity_check;
} {ok}
finish_test