# 2026-11-20 # # ".dbconfig fp_digits" no longer works. ".testctrl fp_digits" is # available, but is read-only without the --unsafe-testing flag, which # this invocation is not suppose to have. # .testcase 100 .dbconfig fp_digits .check --glob unknown dbconfig .testcase 110 .testctrl fp_digits .check 17 .if NOT capable('unsafe-testing') .testcase 120 .testctrl fp_digits 4 .check -glob fp_digits is read-only .endif /* NOT capable('unsafe-testing') */ # 45bcbf3580 2026-11-05T18:08:21Z # A function result that carries a number and its text keeps # the old text after REAL affinity. # .testcase 200 .mode quote CREATE TABLE r(x REAL); INSERT INTO r VALUES(dualrep(5)) RETURNING x || ''; .check "'5.0'" .testcase 300 PRAGMA foreign_keys=ON; CREATE TABLE p(k TEXT UNIQUE); INSERT INTO p VALUES('5.0'); CREATE TABLE c(x REAL REFERENCES p(k)); INSERT INTO c VALUES(5); .check '' .testcase 301 INSERT INTO c VALUES(dualrep(5)); .check '' .testcase 302 SELECT count(*) FROM c; .check 2 # f945de7c4eb73732 2026-11-06T04:16:54Z # sqlite3's .recover output can smuggle shell commands into the next # sqlite3 run # .if capable('vtab') .testcase 400 .open --hexdb | size 8192 pagesize 4096 filename unk.db | page 1 offset 0 | 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3. | 16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 02 .....@ ........ | 32: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 ................ | 48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ................ | 96: 00 00 00 00 0d 00 00 00 01 0f ca 00 0f ca 00 00 ................ | 4032: 00 00 00 00 00 00 00 00 00 00 34 01 06 17 11 11 ..........4..... | 4048: 01 55 74 61 62 6c 65 74 31 74 31 02 43 52 45 41 .Utablet1t1.CREA | 4064: 54 45 20 54 41 42 4c 45 20 74 31 28 61 2c 62 2c TE TABLE t1(a,b, | 4080: 63 29 3b 0a 2e 70 72 69 6e 74 20 68 65 6c 6c 6f c);..print hello | page 2 offset 4096 | 0: 0d 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 ................ | end unk.db .recover .check <<**END-TEST** .dbconfig defensive off .safe BEGIN; PRAGMA writable_schema = on; PRAGMA foreign_keys = off; PRAGMA encoding = 'UTF-8'; PRAGMA page_size = '4096'; PRAGMA auto_vacuum = '0'; PRAGMA user_version = '0'; PRAGMA application_id = '0'; CREATE TABLE t1(a,b,c); PRAGMA writable_schema = off; COMMIT; **END-TEST** .testcase 401 .recover --unsafe .check <<**END-TEST** .dbconfig defensive off BEGIN; PRAGMA writable_schema = on; PRAGMA foreign_keys = off; PRAGMA encoding = 'UTF-8'; PRAGMA page_size = '4096'; PRAGMA auto_vacuum = '0'; PRAGMA user_version = '0'; PRAGMA application_id = '0'; CREATE TABLE t1(a,b,c); PRAGMA writable_schema = off; COMMIT; **END-TEST** .endif /* capable('vtab') */ # Follow-up to f945de7c4eb73732. The ".recover" command must also omit # extraneous text at the end of the sqlite_schema.sql field for views, # triggers, and non-unique indexes, not just for tables. # .open :memory: CREATE TABLE t1(a,b); CREATE INDEX i1 ON t1(a); CREATE VIEW v1 AS SELECT * FROM t1; CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN SELECT 1; END; .dbconfig defensive off .dbconfig writable_schema on UPDATE sqlite_schema SET sql=sql||';'||char(10)||'.print INJECTED_'||name WHERE name IN ('i1','v1','r1'); .testcase 410 .recover .check --glob <? AND x? AND x? AND x