# 2019-01-11 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix corruptL database_may_be_corrupt #------------------------------------------------------------------------- reset_db do_test 1.0 { sqlite3 db {} db deserialize [decode_hexdb { | size 356352 pagesize 4096 filename crash-acaae0347204ae.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 d0 00 00 00 .....@ ........ | 32: 40 00 ea 00 00 00 00 00 00 40 00 00 00 40 00 00 @........@...@.. | 96: 00 00 00 00 0d 00 00 00 04 0e 9c 00 0f ad 0f 4f ...............O | 112: 0e fc 0e 9c 00 00 00 00 00 00 00 00 00 00 00 00 ................ | 3728: 00 00 00 00 00 00 00 00 00 00 00 00 5e 04 07 17 ............^... | 3744: 1f 1f 01 81 0b 74 61 62 6c 65 74 31 5f 70 61 72 .....tablet1_par | 3760: 65 6e 74 74 31 5f 70 61 72 65 6e 74 04 43 52 45 entt1_parent.CRE | 3776: 41 54 45 20 54 41 42 4c 45 20 22 74 31 5f 70 61 ATE TABLE .t1_pa | 3792: 72 65 6e 74 22 28 6e 6f 64 65 6e 6f 20 49 4e 54 rent.(nodeno INT | 3808: 45 47 45 52 20 50 52 49 4d 41 52 59 20 4b 45 59 EGER PRIMARY KEY | 3824: 2c 70 61 72 65 6e 74 6e 6f 64 65 29 51 03 06 17 ,parentnode)Q... | 3840: 1b 1b 01 7b 74 61 62 6c 65 74 31 5f 6e 6f 64 65 ....tablet1_node | 3856: 74 31 5f 6e 6f 64 65 03 43 52 45 41 54 45 20 54 t1_node.CREATE T | 3872: 41 42 4c 45 20 22 74 31 5f 6e 6f 64 65 22 28 6e ABLE .t1_node.(n | 3888: 6f 64 65 6e 6f 20 49 4e 54 45 47 45 52 20 50 52 odeno INTEGER PR | 3904: 49 4d 41 52 59 20 4b 45 59 2c 64 61 74 61 29 5c IMARY KEY,data). | 3920: 02 07 17 1d 1d 01 81 0b 74 61 62 6c 65 74 31 5f ........tablet1_ | 3936: 72 6f 77 69 64 74 31 5f 72 6f 77 69 64 02 43 52 rowidt1_rowid.CR | 3952: 45 41 54 45 20 54 41 42 4c 45 20 22 74 31 5f 72 EATE TABLE .t1_r | 3968: 6f 77 69 64 22 28 72 6f 77 69 64 20 49 4e 54 45 owid.(rowid INTE | 3984: 47 45 52 20 50 52 49 4d 41 52 59 20 4b 45 59 2c GER PRIMARY KEY, | 4000: 6e 6f 64 65 6e 6f 2c 61 30 2c 61 31 29 51 01 07 nodeno,a0,a1)Q.. | 4016: 17 11 11 08 81 0f 74 61 62 6c 65 74 31 74 31 43 ......tablet1t1C | 4032: 52 45 41 54 45 20 56 49 52 54 55 41 4c 20 54 41 REATE VIRTUAL TA | 4048: 42 4c 45 20 74 31 20 55 53 49 4e 47 20 72 74 72 BLE t1 USING rtr | 4064: 65 65 28 69 64 2c 78 30 20 50 52 49 4d 41 52 59 ee(id,x0 PRIMARY | 4080: 20 4b 45 59 2c 70 61 72 65 6e 74 6e 6f 64 65 29 KEY,parentnode) | page 2 offset 4096 | 0: 51 03 06 17 1b 1b 01 7b 74 61 62 6c 65 74 31 5f Q.......tablet1_ | 16: 6e 6f 64 65 74 31 5f 6e 6f 64 65 03 43 52 45 41 nodet1_node.CREA | 32: 54 45 20 54 41 42 4c 45 20 22 74 31 5f 6e 6f 64 TE TABLE .t1_nod | 48: 65 22 28 6e 6f 64 65 6e 6f 20 49 4e 54 45 47 45 e.(nodeno INTEGE | 64: 52 20 50 52 49 4d 41 52 59 20 4b 45 59 2c 64 61 R PRIMARY KEY,da | 80: 74 61 29 5c 02 07 17 1d 1d 01 81 0b 74 61 62 6c ta).........tabl | 96: 65 74 31 5f 72 6f 77 69 64 74 31 5f 72 6f 77 69 et1_rowidt1_rowi | 112: 64 02 43 52 45 41 54 45 20 54 41 42 4c 45 00 00 d.CREATE TABLE.. | 128: 01 0a 02 00 00 00 01 0e 0d 00 00 00 00 24 0e 0d .............$.. | 144: 0c 1a 06 85 50 46 60 27 70 08 00 00 00 00 00 00 ....PF`'p....... | 3824: 00 00 00 00 00 00 00 0d 0e 05 00 09 1d 00 74 6f ..............to | 3840: 79 20 68 61 6c 66 10 0d 05 00 09 23 00 62 6f 74 y half.....#.bot | 3856: 74 6f 6d 20 68 61 6c 66 0f 0c 05 00 09 21 00 72 tom half.....!.r | 3872: 69 67 68 74 20 68 61 6c 66 0e 0b 05 00 09 1f 00 ight half....... | 3888: 6c 65 66 74 20 43 15 f6 e6 f6 46 50 34 35 24 54 left C....FP45$T | 3904: 15 44 52 05 44 14 24 c4 52 02 27 43 15 f6 e6 f6 .DR.D.$.R.'C.... | 3920: 46 52 22 8e 6f 64 65 6e 6f 20 49 4e 54 45 47 45 FR..odeno INTEGE | 3936: 52 20 50 52 49 4d 41 52 59 20 4b 45 59 2c 64 61 R PRIMARY KEY,da | 3952: 74 61 29 5c 02 07 17 1d 1d 01 81 0b 74 61 62 6c ta).........tabl | 3968: 65 74 31 5f 72 6f 74 74 6f 6d 20 65 64 67 65 0f et1_rottom edge. | 3984: 07 05 00 09 21 00 72 69 67 68 74 20 65 64 67 65 ....!.right edge | 4000: 0e 06 05 00 09 1f 00 6c 65 66 74 20 65 64 67 65 .......left edge | 4016: 0b 05 05 00 09 19 00 63 65 6e 74 65 72 17 04 05 .......center... | 4032: 00 09 31 00 75 70 70 65 72 2d 72 69 67 68 74 20 ..1.upper-right | 4048: 63 6f 72 6e 65 72 17 03 05 00 09 31 00 6c 6f 77 corner.....1.low | 4064: 65 72 2d 72 69 67 68 74 20 63 6f 72 6e 65 72 16 er-right corner. | 4080: 02 05 00 09 2f 00 75 70 70 65 72 2d 6c 65 66 74 ..../.upper-left | page 3 offset 8192 | 0: 20 63 6f 72 6e 65 72 16 01 05 00 09 2f 01 8c 6f corner...../..o | 16: 77 65 72 2d 6c 53 51 4c 69 74 65 20 66 6f 72 6d wer-lSQLite form | 32: 61 74 20 33 00 10 00 01 01 00 40 20 20 00 00 00 at 3......@ ... | 48: 00 00 00 00 2f 00 00 0d eb 13 00 00 00 03 00 00 ..../........... | 64: 00 04 00 00 00 00 00 00 00 06 00 00 00 01 00 00 ................ | 80: 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 ................ | page 6 offset 20480 | 128: 00 00 00 00 00 00 00 00 97 3d 04 ae 7c 01 00 00 .........=..|... | 624: 00 00 00 00 00 00 21 97 3d 04 ae 7c 01 00 00 00 ......!.=..|.... | 1120: 00 00 00 00 00 20 97 3d 04 ae 7c 01 00 00 00 00 ..... .=..|..... | 1616: 00 00 00 00 1f 97 3d 04 ae 7c 01 00 00 00 00 00 ......=..|...... | 2112: 00 00 00 1e 97 3d 04 ae 7c 01 00 00 00 00 00 00 .....=..|....... | 2608: 00 00 1d 97 d3 d0 4a e7 c0 00 00 00 00 00 00 00 ......J......... | 3088: 00 00 00 00 00 00 00 00 00 00 00 00 01 f3 00 00 ................ | 3600: 23 97 3d 04 ae 7c 01 00 00 00 00 00 00 00 00 00 #.=..|.......... | 4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 26 ...............& | page 8 offset 28672 | 0: 0d 00 00 00 01 04 30 00 04 30 00 00 00 00 00 00 ......0..0...... | 1072: 97 4d 1e 14 00 ae 7c 00 00 00 00 00 00 00 00 00 .M....|......... | 1088: 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 ................ | 4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 ................ | page 10 offset 36864 | 0: 0d 00 00 00 01 04 30 00 04 30 00 00 00 00 00 00 ......0..0...... | 1072: 9a ee c1 80 fd 78 1f ce 1b ae eb b4 00 00 00 00 .....x.......... | 1088: 13 20 ff 20 00 70 00 00 00 60 50 00 00 00 11 e0 . . .p...`P..... | 1104: 00 00 00 70 00 00 00 60 50 05 35 14 c6 97 46 52 ...p...`P.5...FR | 1120: 06 66 f7 26 d6 17 42 03 30 01 00 00 10 10 04 02 .f.&..B.0....... | 1136: 02 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 .........@...... | 1152: 00 00 00 00 00 40 00 00 00 40 00 00 00 00 00 00 .....@...@...... | 4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 ................ | page 12 offset 45056 | 0: 0d 00 00 00 01 04 30 00 04 30 e1 b4 30 97 4d 46 ......0..0..0.MF | 16: 14 00 ae 7c 00 00 00 00 00 00 00 03 00 00 43 00 ...|..........C. | page 47 offset 188416 | 2512: 00 00 00 00 00 00 00 00 be 00 00 00 00 00 00 00 ................ | page 87 offset 352256 | 2512: 00 00 00 00 00 00 00 00 aa 00 00 00 00 00 00 00 ................ | end crash-acaae0347204ae.db }]} {} do_catchsql_test 1.1 { PRAGMA cell_size_check = off; DROP INDEX t1x1; } {1 {database disk image is malformed}} do_catchsql_test 1.2 { SELECT sum(s+length(b)) FROM t1 WHERE a IN (110,10,150) AND q IS NULL; } {1 {database disk image is malformed}} do_catchsql_test 1.3 { REINDEX t1; } {1 {database disk image is malformed}} do_catchsql_test 1.4 { PRAGMA integrity_check } {1 {database disk image is malformed}} #------------------------------------------------------------------------- reset_db do_test 2.0 { sqlite3 db {} db deserialize [decode_hexdb { | size 20480 pagesize 4096 filename crash.txt.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 05 .....@ ........ | 32: 00 00 00 00 00 00 00 00 00 00 00 05 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 05 0e 55 00 0f 74 0f 3c ..........U..t.< | 112: 0e f9 0e d1 0e 55 00 00 00 00 00 00 00 00 00 00 .....U.......... | 3664: 00 00 00 00 00 7a 05 07 15 11 11 08 81 63 76 69 .....z.......cvi | 3680: 65 77 76 31 76 31 43 52 45 41 54 45 20 56 49 45 ewv1v1CREATE VIE | 3696: 57 20 76 31 28 78 2c 79 29 20 41 53 0a 53 45 4c W v1(x,y) AS.SEL | 3712: 45 43 54 20 74 31 2e 62 2c 74 32 2e 62 20 46 52 ECT t1.b,t2.b FR | 3728: 4f 4d 20 74 31 2c 74 32 20 57 48 45 52 45 20 74 OM t1,t2 WHERE t | 3744: 31 2e 61 3d 74 32 2e 61 20 47 52 4f 55 50 20 42 1.a=t2.a GROUP B | 3760: 59 20 31 20 48 41 56 49 4e 47 20 74 32 2e 63 20 Y 1 HAVING t2.c | 3776: 4e 4f 54 20 4e 55 4c 4c 0a 4c 49 4d 49 54 20 31 NOT NULL.LIMIT 1 | 3792: 30 26 04 06 17 11 11 01 39 74 61 62 6c 65 74 32 0&......9tablet2 | 3808: 74 32 05 43 52 45 41 54 45 20 54 41 42 4c 45 20 t2.CREATE TABLE | 3824: 74 32 28 61 2c 62 2c 63 29 41 03 06 17 15 11 01 t2(a,b,c)A...... | 3840: 6b 69 6e 64 65 78 74 31 78 31 74 31 04 43 52 45 kindext1x1t1.CRE | 3856: 41 54 45 20 49 4e 44 45 58 20 73 31 78 31 20 4f ATE INDEX s1x1 O | 3872: 4e 20 74 31 28 64 29 20 57 48 45 52 45 20 65 65 N t1(d) WHERE ee | 3888: 20 49 53 20 4e 4f 54 20 4e 55 4c 4c 36 02 06 17 IS NOT NULL6... | 3904: 17 11 01 53 69 6e 64 65 78 74 31 61 62 63 74 31 ...Sindext1abct1 | 3920: 03 43 52 45 41 54 45 20 49 4e 44 45 58 20 74 31 .CREATE INDEX t1 | 3936: 61 62 63 20 4f 4e 20 74 31 28 61 2c 62 2c 63 2b abc ON t1(a,b,c+ | 3952: 64 2b 65 29 81 09 01 07 17 11 11 01 81 7d 74 61 d+e)..........ta | 3968: 62 6c 65 74 31 74 31 02 43 52 45 41 54 45 20 54 blet1t1.CREATE T | 3984: 41 42 4c 45 20 74 31 28 61 2c 62 2c 63 2c 64 2c ABLE t1(a,b,c,d, | 4000: 65 2c 66 2c 67 2c 68 2c 6a 2c 6a 6a 2c 6a 6a 6a e,f,g,h,j,jj,jjj | 4016: 2c 6b 2c 61 61 2c 62 62 2c 63 63 2c 64 64 2c 65 ,k,aa,bb,cc,dd,e | 4032: 65 20 44 45 46 41 55 4c 54 20 33 2e 31 34 2c 0a e DEFAULT 3.14,. | 4048: 66 66 20 44 45 46 41 55 4c 54 28 27 68 69 63 63 ff DEFAULT('hicc | 4064: 75 70 27 29 2c 67 67 20 4e 4f 54 20 4e 55 4c 4c up'),gg NOT NULL | 4080: 20 44 45 46 41 55 4c 54 28 66 61 6c 73 65 29 29 DEFAULT(false)) | page 2 offset 4096 | 0: 0d 00 00 00 0a 0e 7b 00 0f dc 0f b6 0f 8f 0f 68 ...............h | 16: 0f 41 0f 1a 0e f3 0e cb 0e a3 0e 7b 00 00 00 00 .A.............. | 3696: 00 00 00 00 00 00 00 00 00 00 00 26 0a 14 01 01 ...........&.... | 3712: 02 08 00 00 00 00 00 00 00 00 00 00 00 00 07 19 ................ | 3728: 08 09 5a 00 b4 40 09 1e b8 51 eb 85 1f 68 69 63 ..Z..@...Q...hic | 3744: 63 75 70 26 09 14 01 01 02 08 00 00 00 00 00 00 cup&............ | 3760: 00 00 00 00 00 00 07 19 08 08 50 00 a0 40 09 1e ..........P..@.. | 3776: b8 51 eb 85 1f 68 69 63 63 75 70 26 08 14 01 01 .Q...hiccup&.... | 3792: 02 08 00 00 00 00 00 00 00 00 00 00 00 00 07 19 ................ | 3808: 08 07 46 00 8c 40 09 1e b8 51 eb 85 1f 68 69 63 ..F..@...Q...hic | 3824: 63 75 70 25 07 14 01 01 01 08 00 00 00 00 00 00 cup%............ | 3840: 00 00 00 00 00 00 07 b9 08 06 3c 78 40 09 1e b8 .............|......... | 1088: 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 ................ | 4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 13 ................ | page 26 offset 102400 | 2512: 00 00 00 00 00 00 00 0a 00 00 00 00 00 00 00 00 ................ | page 27 offset 106496 | 0: 00 00 00 00 00 00 00 12 00 00 00 07 00 00 00 1d ................ | 16: 00 00 00 09 00 00 00 1f 00 00 00 0b 00 00 00 21 ...............! | 32: 00 00 00 0d 00 00 00 25 00 00 00 0f 00 00 00 19 .......%........ | 48: 00 00 00 11 00 00 00 29 00 00 00 13 00 00 00 2b .......).......+ | 64: 00 00 00 15 00 00 00 2d 00 00 00 2e 00 00 00 17 .......-........ | page 28 offset 110592 | 2512: 00 00 00 00 00 00 00 1e 00 00 00 00 00 00 00 00 ................ | page 30 offset 118784 | 2512: 00 00 00 00 00 00 00 32 00 00 00 00 00 00 00 00 .......2........ | page 32 offset 126976 | 2512: 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 .......F........ | page 34 offset 135168 | 2512: 00 00 00 00 00 00 00 5a 00 00 00 00 00 00 00 00 .......Z........ | page 35 offset 139264 | 0: 0a 08 44 00 05 02 77 00 0e 11 0a 33 06 55 02 77 ..D...w....3.U.w | 16: 04 66 00 88 00 88 00 88 00 00 00 00 00 00 00 00 .f.............. | 128: 00 00 00 00 00 00 00 00 04 66 01 ef 00 00 00 00 .........f...... | 624: 00 00 00 00 00 00 00 97 3d 04 ae 7c 01 00 00 00 ........=..|.... | 1120: 00 00 00 00 00 20 97 3d 04 ae 7c 01 00 00 00 00 ..... .=..|..... | 1616: 00 00 00 00 22 97 3d 04 ae 7c 01 00 00 00 00 00 ......=..|...... | 2112: 00 00 00 1e 0c 22 01 ef 00 00 00 00 00 00 00 00 ................ | 2608: 00 00 00 97 3d 04 ae 7c 01 00 00 00 00 00 00 00 ....=..|........ | 3104: 00 1c 00 00 01 ef 00 00 00 00 00 00 00 00 00 00 ................ | 3600: 00 97 3d 04 ae 7c 01 00 00 00 00 00 00 00 00 00 ..=..|.......... | 4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1a ................ | page 36 offset 143360 | 0: 0a 08 44 00 04 02 77 00 06 55 02 77 04 66 0e 11 ..D...w..U.w.f.. | 16: 00 88 00 88 00 88 0e 11 00 00 00 00 00 00 00 00 ................ | 128: 00 00 00 00 00 00 00 00 04 76 01 ef 00 00 00 00 .........v...... | 624: 00 00 00 00 00 00 00 97 3e 04 ae 7c 02 00 00 00 ........>..|.... | 1120: 00 00 00 00 00 2a 97 3e 04 ae 7c 02 00 00 00 00 .....*.>..|..... | 1616: 00 00 00 00 2c 97 3e 04 ae 7c 02 00 00 00 00 00 ....,.>..|...... | 2112: 00 00 00 28 00 00 05 cd 00 00 00 00 00 00 00 00 ...(............ | 3600: 00 97 3e 04 ae 7c 02 00 00 00 00 00 00 00 00 00 ..>..|.......... | 4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2f .............../ | page 38 offset 151552 | 2512: 00 00 00 00 00 00 00 6e 00 00 00 00 00 00 00 00 .......n........ | page 40 offset 159744 | 2512: 00 00 00 00 00 00 00 00 82 00 00 00 00 00 00 00 ................ | page 42 offset 167936 | 2512: 00 00 00 00 00 00 00 00 96 00 00 00 00 00 00 00 ................ | page 44 offset 176128 | 2512: 00 00 00 00 00 00 00 00 aa 00 00 00 00 00 00 00 ................ | page 47 offset 188416 | 2512: 00 00 00 00 00 00 00 00 be 00 00 00 00 00 00 00 ................ | end crash-9ae5502296c949.db }]} {} do_catchsql_test 5.1 { INSERT INTO t1(b) VALUES(zeroblob(40000)); } {1 {database disk image is malformed}} do_catchsql_test 5.2 { DROP INDEX t1x2; } {0 {}} do_catchsql_test 5.3 { INSERT INTO t1(b) VALUES(zeroblob(40000)); } {1 {database disk image is malformed}} #------------------------------------------------------------------------- reset_db do_test 6.0 { sqlite3 db {} db deserialize [decode_hexdb { | size 20480 pagesize 4096 filename crash-d260f001fa015c.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 05 .....@ ........ | 32: 00 00 00 00 00 ff ff f0 00 00 00 02 00 00 00 04 ................ | 48: 00 00 00 00 00 00 00 64 00 00 00 01 00 00 00 00 .......d........ | 96: 00 00 00 00 0d 0f f8 00 04 0e ce 00 0f 4c 0f d3 .............L.. | 112: 0e fa 0e ce 00 00 00 00 00 00 00 00 00 00 00 00 ................ | 3776: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2a 04 ..............*. | 3792: 06 17 13 11 01 3f 69 6e 64 65 78 74 31 62 74 31 .....?indext1bt1 | 3808: 05 43 52 45 41 54 45 20 49 4e 44 45 58 20 74 31 .CREATE INDEX t1 | 3824: 62 20 4f 4e 20 74 31 28 62 29 50 03 06 17 2b 2b b ON t1(b)P...++ | 3840: 01 59 74 61 62 6c 65 73 71 6c 69 74 65 5f 73 65 .Ytablesqlite_se | 3856: 71 75 65 6e 63 65 73 71 6c 69 74 65 5f 73 65 71 quencesqlite_seq | 3872: 75 65 6e 63 65 04 43 52 45 41 54 45 20 54 41 42 uence.CREATE TAB | 3888: 4c 45 20 73 71 6c 69 74 65 5f 73 65 71 75 65 6e LE sqlite_sequen | 3904: 63 65 28 6e 61 6d 65 2c 73 65 71 29 81 04 01 07 ce(name,seq).... | 3920: 17 11 11 01 81 73 74 61 62 6c 65 74 31 74 31 02 .....stablet1t1. | 3936: 43 52 45 41 54 45 20 54 41 42 4c 45 20 74 31 28 CREATE TABLE t1( | 3952: 61 20 52 45 41 4c 20 4e 4f 54 20 4e 55 4c 4c 20 a REAL NOT NULL | 3968: 44 45 46 41 55 4c 54 28 32 35 2b 33 32 29 2c 62 DEFAULT(25+32),b | 3984: 20 46 4c 4f 41 54 2c 63 20 44 4f 55 42 4c 45 20 FLOAT,c DOUBLE | 4000: 55 4e 49 51 55 45 2c 0a 64 20 43 4c 4f 42 2c 65 UNIQUE,.d CLOB,e | 4016: 20 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52 59 INTEGER PRIMARY | 4032: 20 4b 45 59 20 41 55 54 4f 49 4e 43 52 45 4d 45 KEY AUTOINCREME | 4048: 4e 54 29 23 02 06 17 37 11 01 00 69 6e 64 65 78 NT)#...7...index | 4064: 73 71 6c 69 74 65 5f 61 75 74 6f 69 6e 64 65 78 sqlite_autoindex | 4080: 5f 74 31 5f 31 74 31 05 00 00 00 08 00 00 00 00 _t1_1t1......... | page 2 offset 4096 | 0: 0d 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 ................ | page 3 offset 8192 | 0: 0a 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 ................ | page 4 offset 12288 | 0: 0d 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 ................ | page 5 offset 16384 | 0: 0a 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 ................ | end crash-d260f001fa015c.db }]} {} do_catchsql_test 6.1 { BEGIN; INSERT INTO t1(b) VALUES(1); INSERT INTO t1(b) VALUES(2); COMMIT; } {1 {malformed database schema (t1b) - invalid rootpage}} #------------------------------------------------------------------------- reset_db do_test 7.0 { sqlite3 db {} db deserialize [decode_hexdb { | size 20480 pagesize 4096 filename crash-8391315d75edff.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 05 .....@ ........ | 32: 00 00 00 00 00 00 00 00 00 00 00 05 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 05 0e 55 00 0f 74 0f 3c ..........U..t.< | 112: 0e f9 0e d1 0e 55 00 00 00 00 00 00 00 00 00 00 .....U.......... | 3664: 00 00 00 00 00 7a 05 07 15 11 11 08 81 63 76 69 .....z.......cvi | 3680: 65 77 76 31 76 31 43 52 45 41 54 45 20 56 49 45 ewv1v1CREATE VIE | 3696: 57 20 76 31 28 78 2c 69 29 20 41 53 0a 53 45 4c W v1(x,i) AS.SEL | 3712: 45 43 54 20 74 31 2e 62 2c 74 32 2e 62 20 46 52 ECT t1.b,t2.b FR | 3728: 4f 4d 20 74 31 2c 74 32 20 57 48 45 52 45 20 74 OM t1,t2 WHERE t | 3744: 31 2e 61 3d 74 32 2e 61 20 47 52 4f 55 50 20 42 1.a=t2.a GROUP B | 3760: 59 20 31 20 48 41 56 49 4e 47 20 74 32 2e 63 20 Y 1 HAVING t2.c | 3776: 4e 4f 54 20 4e 55 4c 4c 0a 4c 49 4d 49 54 20 31 NOT NULL.LIMIT 1 | 3792: 30 26 04 06 17 11 11 01 39 74 61 62 6c 65 74 32 0&......9tablet2 | 3808: 74 32 05 43 52 45 41 54 45 20 54 41 42 4c 45 20 t2.CREATE TABLE | 3824: 74 32 28 61 2c 62 2c 63 29 41 03 06 17 15 11 01 t2(a,b,c)A...... | 3840: 6b 69 6e 64 65 78 74 31 78 31 74 31 03 43 52 45 kindext1x1t1.CRE | 3856: 41 54 45 20 49 4e 44 45 58 20 74 31 78 31 20 4f ATE INDEX t1x1 O | 3872: 4e 20 74 31 28 64 29 20 57 48 45 52 45 20 65 65 N t1(d) WHERE ee | 3888: 20 49 53 20 4e 4f 54 20 4e 55 4c 4c 36 02 06 17 IS NOT NULL6... | 3904: 17 11 01 53 69 6e 64 65 78 74 31 61 62 63 74 31 ...Sindext1abct1 | 3920: 03 43 52 45 41 54 45 20 49 4e 44 45 58 20 74 31 .CREATE INDEX t1 | 3936: 61 62 63 20 4f 4e 20 74 31 28 61 2c 62 2c 63 2b abc ON t1(a,b,c+ | 3952: 64 2b 65 29 81 09 01 07 17 11 11 01 81 7d 74 61 d+e)..........ta | 3968: 62 6c 65 74 31 74 31 02 43 52 45 41 54 45 20 54 blet1t1.CREATE T | 3984: 41 42 4c 45 20 74 31 28 61 2c 62 2c 63 2c 64 2c ABLE t1(a,b,c,d, | 4000: 65 2c 66 2c 67 2c 68 2c 6a 2c 6a 6a 2c 6a 6a 6a e,f,g,h,j,jj,jjj | 4016: 2c 6b 2c 61 61 2c 62 69 8c 63 63 2c 64 64 2c 65 ,k,aa,bi.cc,dd,e | 4032: 65 20 44 45 46 41 55 4c 54 20 33 2e 31 34 2c 0a e DEFAULT 3.14,. | 4048: 66 66 20 44 45 46 41 55 4c 54 28 27 68 69 63 63 ff DEFAULT('hicc | 4064: 75 70 27 29 2c 67 67 20 4e 4f 54 20 4e 55 4c 4c up'),gg NOT NULL | 4080: 20 44 45 46 41 55 4c 54 28 66 61 6c 73 65 29 29 DEFAULT(false)) | page 2 offset 4096 | 0: 0d 00 00 00 0a 0e 7b 00 0f dc 0f b6 0f 8f 0f 68 ...............h | 16: 0f 41 0f 1a 0e f3 0e cb 0e a3 0e 22 00 00 00 00 .A.............. | 3696: 00 00 00 00 00 00 00 00 00 00 00 26 0a 14 01 01 ...........&.... | 3712: 02 08 00 00 00 00 00 00 00 00 00 00 00 00 07 19 ................ | 3728: 08 09 5a 00 b4 40 09 1e b8 51 eb 95 1f 68 69 63 ..Z..@...Q...hic | 3744: 63 75 70 26 09 14 01 01 02 08 00 00 00 00 00 00 cup&............ | 3760: 00 00 00 00 00 00 07 19 08 08 50 00 a0 40 09 1e ..........P..@.. | 3776: b8 51 eb 85 1f 68 69 63 63 74 70 26 08 14 01 01 .Q...hicctp&.... | 3792: 03 08 00 00 00 00 00 00 00 00 00 00 00 00 07 19 ................ | 3808: 08 07 46 00 8c 40 09 1e b8 51 eb 85 1f 68 69 63 ..F..@...Q...hic | 3824: 63 75 70 25 07 14 01 01 01 08 00 00 00 00 00 00 cup%............ | 3840: 00 00 00 00 00 10 07 19 08 06 3c 78 40 09 1e b8 .................. | 1616: 00 00 00 00 1f 97 00 00 00 00 00 00 00 00 00 00 ................ | 2112: 00 00 00 1e 97 3d 00 00 00 00 00 00 00 00 00 00 .....=.......... | 2608: 00 1d 97 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ | page 8 offset 28672 | 1184: 00 00 00 00 00 00 00 00 00 97 4d 1e 13 ff ae 7c ..........M....| | 4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 ................ | page 9 offset 32768 | 256: 0d 01 c0 00 01 04 30 00 04 30 00 00 00 00 00 00 ......0..0...... | page 10 offset 36864 | 0: 0d 00 22 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ | 4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 ................ | page 12 offset 45056 | 0: 0d 00 00 00 01 04 30 00 00 00 00 00 00 00 00 00 ......0......... | page 14 offset 53248 | 0: 0d 00 00 00 01 04 30 00 04 30 00 00 00 00 00 00 ......0..0...... | 1072: 96 4d 5a 14 00 00 00 00 00 00 00 00 00 00 00 00 .MZ............. | page 16 offset 61440 | 0: 0d 00 00 00 01 04 30 00 04 30 00 00 00 00 00 00 ......0..0...... | 1072: 97 4d 6e 14 00 ae 7b ff ff ff ff 00 00 00 00 00 .Mn............. | page 18 offset 69632 | 1056: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 97 ................ | 1072: 4d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 M............... | 4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0d ................ | page 20 offset 77824 | 1056: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 97 ................ | 1072: 4d 81 16 14 00 ae 00 00 00 00 00 00 00 00 00 00 M............... | 4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0f ................ | page 22 offset 86016 | 0: 0d 00 00 00 01 04 2f 00 04 2f 01 00 00 00 00 00 ....../../...... | 1056: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 97 ................ | 1072: 4d 81 2a 14 00 00 00 00 00 00 00 00 00 00 00 00 M.*............. | page 24 offset 94208 | 1072: 00 97 4c 0a 14 00 ae 7c 00 00 00 00 00 00 00 00 ..L....|........ | page 25 offset 98304 | 1056: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 97 ................ | 1072: 4d 81 3e 14 00 ae 7c 00 00 18 ff 00 00 00 00 00 M.>...|......... | page 27 offset 106496 | 0: 00 00 00 00 00 00 00 12 00 00 00 07 00 00 00 1d ................ | 16: 00 00 00 09 00 00 00 1f 00 00 00 0b 00 00 00 21 ...............! | 32: 00 00 00 0d 00 10 00 25 00 00 00 0f 00 00 00 27 .......%.......' | 48: 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 00 ................ | page 32 offset 126976 | 2512: 00 00 00 00 00 00 00 45 21 00 00 00 00 00 00 00 .......E!....... | page 35 offset 139264 | 0: 00 0a 08 44 00 05 02 77 00 0e 11 0a 92 00 00 00 ...D...w........ | 1120: 00 00 00 00 00 20 97 00 00 00 00 00 00 00 00 00 ..... .......... | 1616: 00 00 00 00 22 00 00 00 00 00 00 00 00 00 00 00 ................ | 2608: 00 00 00 97 3d 04 00 00 00 00 00 00 00 00 00 00 ....=........... | 3104: 00 1c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ | 3600: 00 97 3d 04 ae 7c 00 00 00 00 00 00 00 00 00 00 ..=..|.......... | 4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1a ................ | page 36 offset 143360 | 0: 0a 08 44 00 04 02 00 00 00 00 00 00 00 00 00 00 ..D............. | 1120: 00 00 00 00 00 2a 97 3e 04 00 00 00 00 00 00 00 .....*.>........ | 1616: 00 00 00 00 2c 97 3e 00 00 00 00 00 00 00 00 00 ....,.>......... | 2112: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 ...............8 | 2128: 00 00 05 cd 00 00 00 00 00 00 00 00 00 00 00 00 ................ | 3600: 00 97 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ | page 38 offset 151552 | 2464: 00 00 00 00 00 00 00 00 00 6e 00 00 00 00 00 00 .........n...... | page 40 offset 159744 | 2512: 00 00 00 00 00 00 00 00 82 00 00 00 00 00 00 00 ................ | page 42 offset 167936 | 2512: 00 00 00 00 00 00 00 96 00 00 00 00 00 00 00 00 ................ | page 44 offset 176128 | 2512: 00 00 00 00 00 00 00 00 aa 00 00 00 00 00 00 00 ................ | end crash-41390d95d613b6.db }]} {} do_catchsql_test 10.1 { PRAGMA writable_schema=ON; -- bypass improved sqlite_master consistency checking SELECT * FROM t1 WHERE a<='2019-05-09' ORDER BY a DESC; } {1 {database disk image is malformed}} #------------------------------------------------------------------------- reset_db do_test 11.0 { sqlite3 db {} db deserialize [decode_hexdb { | size 595 pagesize 512 filename x.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: 02 00 00 01 00 40 20 20 00 01 00 0c 00 00 00 07 .....@ ........ | 32: 00 00 00 05 07 a1 1f fa 00 00 00 08 00 00 00 04 ................ | 48: 00 00 01 00 00 49 00 00 00 00 00 05 00 00 00 00 .....I.......... | 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1c ................ | 96: 00 2e 2c 50 0d 00 00 00 06 01 06 00 01 da 01 b0 ..,P............ | 112: 01 56 01 86 01 2a 01 06 00 00 62 00 00 00 00 00 .V...*....b..... | 128: 00 ed e2 78 74 64 33 ff 43 52 45 41 54 45 20 49 ...xtd3.CREATE I | 144: 4e 44 45 58 20 74 33 78 20 4f 4e 20 74 33 28 38 NDEX t3x ON t3(8 | 160: 29 2e 04 06 17 15 11 01 45 69 6e 64 65 68 74 32 ).......Eindeht2 | 176: 63 64 74 31 e5 43 52 45 41 54 45 20 49 4e 44 45 cdt1.CREATE INDE | 192: 58 20 74 32 63 c4 20 4f 4e 20 74 32 28 63 2c 64 X t2c. ON t2(c,d | 208: 29 28 05 06 17 01 11 11 3d 74 61 6c 36 74 62 74 )(......=tal6tbt | 224: 65 32 04 43 52 45 41 54 45 20 54 41 42 4c 45 20 e2.CREATE TABLE | 240: 74 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 t............... | 256: 00 00 00 00 00 00 22 07 06 17 11 11 01 30 e8 03 .............0.. | 272: 62 6c 65 74 34 74 35 02 43 52 45 41 54 45 20 54 blet4t5.CREATE T | 288: 41 42 4c 45 20 74 34 28 94 29 2a 06 06 17 13 11 ABLE t4(.)*..... | 304: 01 3f 69 33 74 6e 65 78 78 74 64 33 ff 43 52 45 .?i3tnexxtd3.CRE | 320: 41 54 45 20 49 4e 44 45 58 20 74 33 78 20 4f 4e ATE INDEX t3x ON | 336: 20 74 31 28 38 29 2e 04 06 17 15 11 01 45 69 6e t1(8).......Ein | 352: 64 65 68 74 32 63 64 74 31 e5 43 52 45 41 54 45 deht2cdt1.CREATE | 368: 20 49 4e 44 45 58 20 74 32 63 c4 20 4f 4e 20 74 INDEX t2c. ON t | 384: 32 28 63 2c 64 29 28 05 06 17 01 11 11 3d 74 61 2(c,d)(......=ta | 400: 6c 32 74 62 74 65 32 04 43 52 45 41 54 45 20 54 l2tbte2.CREATE T | 416: 41 42 4c 45 20 74 33 28 63 2c 78 2c 65 2c 66 29 ABLE t3(c,x,e,f) | 432: 28 02 06 17 11 11 01 3d 74 61 9e 93 65 74 32 74 (......=ta..et2t | 448: 32 03 43 52 45 41 54 45 20 54 41 42 4c 45 20 74 2.CREATE TABLE t | 464: 32 28 63 2c 64 2c 65 2c 66 29 24 01 06 17 11 11 2(c,d,e,f)$..... | 480: 01 35 55 61 62 6c 88 74 31 74 31 02 43 52 45 41 .5Uabl.t1t1.CREA | 496: 54 45 20 54 41 42 4c 45 20 74 31 28 61 2c 62 29 TE TABLE t1(a,b) | page 2 offset 512 | 0: 0d 00 00 00 0d 25 00 01 cf 00 01 fa 01 f3 01 de .....%.......... | 16: 01 00 00 00 fd 00 00 0d 00 00 00 00 45 20 54 41 ............E TA | 32: 42 4c 45 20 74 34 28 94 29 2a 06 06 17 13 11 01 BLE t4(.)*...... | 48: 3f 69 33 74 6e 65 78 78 74 64 33 ff 43 52 45 a0 ?i3tnexxtd3.CRE. | 64: a0 a0 a0 a0 a0 a0 a0 a0 a0 a0 a0 a0 74 13 11 01 ............t... | 80: 49 45 74 00 00 00 00 00 00 00 00 00 00 00 00 00 IEt............. | end x.db }]} {} do_catchsql_test 11.1 { PRAGMA writable_schema=ON; -- bypass improved sqlite_master consistency checking DELETE FROM t3 WHERE x IN (SELECT x FROM t4); } {1 {database disk image is malformed}} #------------------------------------------------------------------------- reset_db do_test 12.0 { sqlite3 db {} db deserialize [decode_hexdb { | size 12288 pagesize 4096 filename crash-e6d070858a3a85.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 00 .....@ ........ | 96: 00 00 00 00 0d 00 00 00 02 0f 8f 00 0f bf 0f 8f ................ | 3968: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2e ................ | 3984: 02 06 17 15 11 01 45 69 6e 64 65 78 74 31 63 62 ......Eindext1cb | 4000: 74 31 03 43 52 45 41 54 45 20 49 4e 44 45 58 20 t1.CREATE INDEX | 4016: 74 31 63 62 20 4f 4e 20 74 31 28 63 2c 62 29 3f t1cb ON t1(c,b)? | 4032: 01 06 17 11 11 01 6b 74 61 62 6c 65 74 31 74 31 ......ktablet1t1 | 4048: 02 43 52 45 41 54 45 20 54 41 42 4c 45 20 74 31 .CREATE TABLE t1 | 4064: 28 61 20 49 4e 54 2c 20 62 20 49 4e 54 2c 20 43 (a INT, b INT, C | 4080: 20 49 4e 54 20 44 45 46 41 55 4c 54 20 31 36 29 INT DEFAULT 16) | page 2 offset 4096 | 0: 0d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ | 4000: 00 00 00 00 00 00 00 00 07 0b 04 01 01 01 63 63 ..............cc | 4016: 11 05 0a 04 00 00 01 11 05 09 04 08 08 01 0f 05 ................ | 4032: 08 04 00 00 01 01 56 07 04 01 08 01 07 10 07 06 ......V......... | 4048: 14 01 01 01 06 08 10 06 05 04 f5 00 01 05 10 07 ................ | 4064: 04 04 01 01 01 04 03 10 06 03 04 01 09 01 03 10 ................ | 4080: 06 02 04 01 00 01 02 10 06 01 04 09 01 01 02 10 ................ | page 3 offset 8192 | 0: 0a 00 00 00 0b 0f b0 00 0f f9 0f f2 0f eb 0f e4 ................ | 16: 0f dd 0f d6 0f 9f 0f c7 0f be 00 00 00 00 00 00 ................ | 4016: 07 04 01 01 01 11 e2 0b 06 04 91 00 01 11 0a 07 ................ | 4032: 04 01 01 01 10 08 06 07 04 01 01 01 10 04 04 06 ................ | 4048: 04 01 01 09 10 02 06 04 01 0a 01 10 00 00 00 00 ................ | end crash-e6d070858a3a85.db }]} {} do_catchsql_test 12.1 { SELECT CAST((SELECT b FROM t1 WHERE 16=c) AS int) FROM t1 WHERE 16=c; } {1 {database disk image is malformed}} #------------------------------------------------------------------------- reset_db do_test 13.0 { sqlite3 db {} db deserialize [decode_hexdb { | size 8192 pagesize 4096 filename crash-81dd2952aef34f.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 c4 00 0f c4 00 00 ................ | 4032: 00 00 00 00 3a 11 06 17 11 11 01 61 74 61 62 6c ....:......atabl | 4048: 65 74 31 74 31 02 43 52 45 41 54 45 20 54 41 42 et1t1.CREATE TAB | 4064: 4c 45 20 74 31 28 61 20 49 4e 54 45 47 45 52 20 LE t1(a INTEGER | 4080: 50 52 49 4d 41 52 59 20 4b 45 59 2c 62 2c 63 29 PRIMARY KEY,b,c) | page 2 offset 4096 | 0: 0d 07 70 00 02 0f eb 00 0f fa 00 00 00 00 00 00 ..p............. | 4064: 00 00 00 00 00 00 00 00 00 00 00 05 bf ff ff ff ................ | 4080: ff ff ff ff ff 04 00 01 00 02 04 01 00 00 00 00 ................ | end crash-81dd2952aef34f.db }]} {} do_catchsql_test 13.1 { WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x-2019 FROM c WHERE x<2) INSERT INTO t1(b,c) SELECT last_insert_rowid(), x FROM c; } {1 {database disk image is malformed}} #------------------------------------------------------------------------- reset_db do_test 14.0 { sqlite3 db {} db deserialize [decode_hexdb { | size 512 pagesize 65536 filename clusterfuzz-testcase-minimized-sqlite3_dbfuzz2_fuzzer-4806406219825152 | 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: 00 01 02 01 00 40 20 20 00 63 2e 78 00 00 00 07 .....@ .c.x.... | 32: 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 04 ................ | 48: 00 00 00 00 00 00 01 00 35 05 43 00 04 00 00 00 ........5.C..... | 80: 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 0c ................ | 96: 00 2e 2c 50 0d 00 00 00 03 00 00 00 01 da 01 b0 ..,P............ | 112: 01 56 01 86 01 2a 01 02 00 00 00 00 00 00 00 1c .V...*.......... | 128: 00 38 80 b2 e6 0e 00 00 00 00 00 00 00 00 00 10 .8.............. | 144: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 ................ | 160: 00 00 00 00 00 00 00 00 00 00 00 00 45 20 54 41 ............E TA | 256: 00 00 00 00 00 00 22 07 06 17 11 11 01 35 74 61 .............5ta | 272: 62 6c 00 10 00 00 34 07 43 52 54 45 20 54 41 42 bl....4.CRTE TAB | 288: 4c 45 20 74 33 28 63 2e 78 2c 65 2c 66 15 28 3a LE t3(c.x,e,f.(: | 304: 06 17 11 11 01 65 78 8c cc 87 85 35 05 43 72 45 .....ex....5.CrE | 320: 41 54 48 20 49 4e 44 45 58 20 74 33 78 20 4f 4e ATH INDEX t3x ON | 336: 20 74 33 28 78 39 2e 04 06 17 15 11 01 45 69 6e t3(x9.......Ein | 352: 64 65 78 74 32 63 64 74 32 05 43 52 45 41 54 45 dext2cdt2.CREATE | 368: 20 49 4e 44 45 58 20 74 32 63 64 20 4f 4e 20 74 INDEX t2cd ON t | 384: 32 28 63 2a 44 29 28 05 fa e8 ee ed 01 3d 74 63 2(c*D)(......=tc | 400: 62 6c 65 74 33 74 33 07 43 52 45 41 54 45 20 54 blet3t3.CREATE T | 416: 41 42 4c 45 20 74 33 28 63 2e 78 2c 65 2c 66 15 ABLE t3(c.x,e,f. | 432: 28 3a 06 17 11 11 01 3d 74 61 62 6c 65 74 32 74 (:.....=tablet2t | 448: 32 03 43 52 45 41 54 45 20 54 41 42 4c 45 20 74 2.CREATE TABLE t | 464: 32 28 63 2c 64 2c 65 2c 66 29 24 01 06 17 11 11 2(c,d,e,f)$..... | 480: 01 35 74 61 62 6c 65 74 31 74 31 02 43 52 45 41 .5tablet1t1.CREA | 496: 54 45 20 54 41 42 4c 45 20 74 31 28 61 2c 63 29 TE TABLE t1(a,c) | end clusterfuzz-testcase-minimized-sqlite3_dbfuzz2_fuzzer-4806406219825152 }]} {} extra_schema_checks 0 do_catchsql_test 14.1 { PRAGMA integrity_check; } {1 {database disk image is malformed}} # If SQLITE_OMIT_ALTERTABLE is defined, omit this file. ifcapable altertable { do_catchsql_test 14.2 { ALTER TABLE t1 RENAME TO alkjalkjdfiiiwuer987lkjwer82mx97sf98788s9789s; } {1 {database disk image is malformed}} } extra_schema_checks 1 #------------------------------------------------------------------------- reset_db do_test 15.0 { sqlite3 db {} db deserialize [decode_hexdb { | size 28672 pagesize 4096 filename crash-3afa1ca9e9c1bd.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 07 .....@ ........ | 32: 00 00 00 00 00 00 00 00 00 00 00 06 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 06 0e 88 00 0f b8 0f 6d ...............m | 112: 0f 3a 0f 0b 0e d5 0e 88 01 00 00 00 00 00 00 00 .:.............. | 3712: 00 00 00 00 00 00 00 00 4b 06 06 17 25 25 01 5b ........K...%%.[ | 3728: 74 61 62 6c 65 73 71 6c 69 74 65 5f 73 74 61 74 tablesqlite_stat | 3744: 31 73 71 6c 69 74 65 5f 73 74 61 74 31 07 43 52 1sqlite_stat1.CR | 3760: 45 41 54 45 20 54 41 42 4c 45 20 73 71 6c 69 74 EATE TABLE sqlit | 3776: 65 5f 73 74 61 74 31 28 74 62 6c 2c 69 64 78 2c e_stat1(tbl,idx, | 3792: 73 74 61 74 29 34 05 06 17 13 11 01 53 69 6e 64 stat)4......Sind | 3808: 65 78 63 31 63 63 31 06 43 52 45 41 54 45 20 55 exc1cc1.CREATE U | 3824: 4e 49 51 55 45 20 49 4e 44 45 58 20 63 31 63 20 NIQUE INDEX c1c | 3840: 4f 4e 20 63 31 28 63 2c 20 62 29 2d 04 06 17 13 ON c1(c, b)-.... | 3856: 11 01 45 69 6e 64 65 78 63 31 64 63 31 05 43 52 ..Eindexc1dc1.CR | 3872: 45 41 54 45 20 49 4e 44 45 58 20 63 31 64 20 4f EATE INDEX c1d O | 3888: 4e 20 63 31 28 64 2c 20 62 29 31 03 06 17 13 11 N c1(d, b)1..... | 3904: 01 4d 69 6e 64 65 78 62 31 63 62 31 05 43 52 45 .Mindexb1cb1.CRE | 3920: 41 54 45 20 55 4e 49 51 55 45 20 49 4e 44 45 58 ATE UNIQUE INDEX | 3936: 20 62 31 63 20 4f 4e 20 62 31 28 63 29 49 02 06 b1c ON b1(c)I.. | 3952: 17 11 11 0f 7f 74 61 62 6c 65 63 31 63 31 03 43 .....tablec1c1.C | 3968: 52 45 41 54 45 20 54 41 42 4c 45 20 63 31 28 61 REATE TABLE c1(a | 3984: 20 49 4e 54 20 50 52 49 4d 41 52 59 20 4b 45 59 INT PRIMARY KEY | 4000: 2c 20 62 2c 20 63 2c 20 64 29 20 57 49 54 48 4f , b, c, d) WITHO | 4016: 55 54 20 52 4f 57 49 44 46 01 06 17 11 11 01 79 UT ROWIDF......y | 4032: 74 61 62 6c 65 62 31 62 31 02 43 52 45 41 54 45 tableb1b1.CREATE | 4048: 20 54 41 42 4c 45 20 62 31 28 61 20 49 4e 54 20 TABLE b1(a INT | 4064: 50 52 49 4d 41 52 59 20 4b 45 59 2c 20 62 2c 20 PRIMARY KEY, b, | 4080: 63 29 20 57 49 54 48 4f 55 54 20 52 4f 57 49 44 c) WITHOUT ROWID | page 2 offset 4096 | 0: 0a 00 00 00 07 0f ca 00 0f fa 0f f2 0f ea 0f e2 ................ | 16: 0f da 00 00 00 01 00 00 00 00 00 00 00 00 00 00 ................ | 4032: 00 00 00 00 00 00 00 00 00 00 07 04 01 0f 01 06 ................ | 4048: 67 07 07 04 01 0f 01 06 66 06 07 04 01 0f 01 05 g.......f....... | 4064: 65 05 07 04 01 0f 01 04 64 04 07 04 01 0f 01 03 e.......d....... | 4080: 63 03 07 04 01 0f 01 02 62 0f 05 04 09 0f 09 61 c.......b......a | page 3 offset 8192 | 0: 0a 00 00 00 07 0f bd 00 0f f9 0f ef 0f e5 0f db ................ | 16: 0f d1 0f c7 0f bd 00 00 00 00 01 00 00 00 00 00 ................ | 4016: 00 00 00 00 00 00 00 00 00 00 00 00 00 09 05 01 ................ | 4032: 0f 01 01 07 61 07 07 09 05 01 0f 01 01 06 61 06 ....a.........a. | 4048: 06 09 05 01 0f 01 01 05 61 05 05 09 05 01 0f 01 ........a....... | 4064: 01 04 61 04 04 09 05 01 0f 01 01 03 61 03 03 09 ..a.........a... | 4080: 05 01 0f 01 01 02 61 0f 02 06 05 09 0f 09 09 61 ......a........a | page 4 offset 12288 | 0: 0a 00 00 00 07 0f d8 00 0f fc 0f f0 0f ea 0f e4 ................ | 16: 0f de 0f d8 0f f6 00 00 00 00 00 00 00 00 00 00 ................ | 4048: 00 00 00 00 00 00 00 00 05 03 01 01 07 07 05 03 ................ | 4064: 01 01 06 06 05 03 01 01 05 05 05 03 01 01 04 04 ................ | 4080: 05 03 01 01 03 03 05 03 01 01 0f 02 03 03 09 09 ................ | page 5 offset 16384 | 0: 0a 00 00 00 07 0f ca 00 0f fa 0f f2 0f ea 0f 00 ................ | 4032: 00 00 00 00 00 00 00 00 00 00 07 04 01 0f 01 07 ................ | 4048: 61 07 07 04 01 0f 01 06 61 06 07 04 01 0f 01 05 a.......a....... | 4064: 61 05 07 04 01 1f 01 04 61 04 07 04 01 0f 01 03 a.......a....... | 4080: 61 03 07 04 01 0f 01 02 61 02 05 04 09 0f 09 61 a.......a......a | page 6 offset 20480 | 0: 0a 00 00 00 07 0f ca 00 0f fa 0f ea 0f e2 00 00 ................ | 4032: 00 00 00 00 00 00 00 00 00 00 07 04 01 0f 01 07 ................ | 4048: 61 07 07 04 01 0f 01 06 61 06 07 04 01 0f 01 05 a.......a....... | 4064: 61 05 07 04 01 0f 01 04 61 04 07 04 01 0f 01 03 a.......a....... | 4080: 61 03 07 04 01 0f 01 0f 61 02 05 04 09 0f 09 61 a.......a......a | page 7 offset 24576 | 0: 0d 00 00 00 05 0f 1c 00 0f f0 0f e0 0f d3 0f c5 ................ | 16: 0f b8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ | 4016: 00 00 00 00 00 00 00 00 0b 05 04 11 11 13 62 31 ..............b1 | 4032: 62 31 37 20 31 0c 04 04 11 13 13 62 31 62 31 63 b17 1......b1b1c | 4048: 37 20 31 0b 03 04 11 11 13 63 31 63 31 37 20 31 7 1......c1c17 1 | 4064: 0e 02 04 11 13 07 63 31 63 31 64 37 20 31 20 31 ......c1c1d7 1 1 | 4080: 0e 01 04 11 13 17 63 31 63 31 63 37 20 31 00 00 ......c1c1c7 1.. | end crash-3afa1ca9e9c1bd.db }]} {} extra_schema_checks 0 do_execsql_test 15.1 { PRAGMA cell_size_check = 0; UPDATE c1 SET c= NOT EXISTS(SELECT 1 FROM c1 ORDER BY (SELECT 1 FROM c1 ORDER BY a)) +10 WHERE d BETWEEN 4 AND 7; } {} extra_schema_checks 1 #------------------------------------------------------------------------- reset_db do_execsql_test 16.0 { CREATE TABLE t1(w, x, y, z, UNIQUE(w, x), UNIQUE(y, z)); INSERT INTO t1 VALUES(1, 1, 1, 1); CREATE TABLE t1idx(x, y, i INTEGER, PRIMARY KEY(x)) WITHOUT ROWID; INSERT INTO t1idx VALUES(10, NULL, 5); PRAGMA writable_schema = 1; UPDATE sqlite_master SET rootpage = ( SELECT rootpage FROM sqlite_master WHERE name='t1idx' ) WHERE type = 'index'; } extra_schema_checks 0 db close sqlite3 db test.db extra_schema_checks 1 do_catchsql_test 16.1 { PRAGMA writable_schema = ON; INSERT INTO t1(rowid, w, x, y, z) VALUES(5, 10, 11, 10, NULL); } {1 {database disk image is malformed}} #------------------------------------------------------------------------- # Test that corruption is reported from within a checkpoint if the # expected final size of the database (according to the last commit # frame in the wal file) is greater than the combined initial sizes # of the database and wal file. # if {[wal_is_capable]} { reset_db do_execsql_test 17.0 { CREATE TABLE t1(o INTEGER PRIMARY KEY, t UNIQUE); INSERT INTO t1(t) VALUES(randomblob(123)); INSERT INTO t1(t) SELECT randomblob(123) FROM t1; INSERT INTO t1(t) SELECT randomblob(123) FROM t1; INSERT INTO t1(t) SELECT randomblob(123) FROM t1; INSERT INTO t1(t) SELECT randomblob(123) FROM t1; INSERT INTO t1(t) SELECT randomblob(123) FROM t1; INSERT INTO t1(t) SELECT randomblob(123) FROM t1; INSERT INTO t1(t) SELECT randomblob(123) FROM t1; INSERT INTO t1(t) SELECT randomblob(123) FROM t1; INSERT INTO t1(t) SELECT randomblob(123) FROM t1; PRAGMA journal_mode = wal; INSERT INTO t1 VALUES(-1, 'b'); } {wal} do_test 17.1 { set fd [open test.db r+] chan truncate $fd 2048 file size test.db } {2048} do_catchsql_test 17.2 { PRAGMA wal_checkpoint } {1 {database disk image is malformed}} do_test 17.3 { close $fd } {} } #------------------------------------------------------------------------- reset_db do_test 18.0 { sqlite3 db {} db deserialize [decode_hexdb { .open --hexdb | size 12288 pagesize 4096 filename crash-40d5739835cbdb.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 00 .....@ ........ | 96: 00 00 00 00 0d 00 00 00 02 0f 4e 00 0f a2 0f 4e ..........N....N | 3904: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 02 ..............R. | 3920: 07 17 11 11 01 81 0f 74 61 62 6c 65 74 32 74 32 .......tablet2t2 | 3936: 03 43 52 45 41 54 45 20 54 41 42 4c 45 20 74 32 .CREATE TABLE t2 | 3952: 28 61 20 49 4e 54 2c 20 62 20 49 4e 54 45 47 45 (a INT, b INTEGE | 3968: 52 2c 20 50 52 49 4d 41 52 59 20 4b 45 59 28 61 R, PRIMARY KEY(a | 3984: 2c 62 29 29 20 57 49 54 48 4f 55 54 20 52 4f 57 ,b)) WITHOUT ROW | 4000: 49 44 5c 01 07 16 11 11 01 81 23 74 61 62 6c 65 ID........#table | 4016: 74 31 74 31 02 43 52 45 41 54 45 20 54 41 42 4c t1t1.CREATE TABL | 4032: 45 20 74 31 28 61 20 49 4e 54 20 50 52 49 4d 41 E t1(a INT PRIMA | 4048: 52 59 20 4b 45 59 2c 20 62 20 54 45 58 54 2c 20 RY KEY, b TEXT, | 4064: 63 20 54 45 58 54 2c 20 64 20 49 4e 54 45 47 45 c TEXT, d INTEGE | 4080: 52 29 20 57 49 54 48 4f 55 54 20 52 4f 57 49 44 R) WITHOUT ROWID | page 2 offset 4096 | 0: 0a 00 00 00 06 0f a7 00 0f f4 0f e5 0f d5 0f c5 ................ | 16: 0f b6 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ | 4000: 00 00 00 00 00 00 00 0f 05 01 15 13 01 06 65 7f ..............e. | 4016: 25 6e 73 69 78 06 0e 05 01 13 15 03 b5 6f 64 64 %nsix........odd | 4032: 66 69 76 65 05 0f 05 01 15 15 01 04 65 76 65 61 five........evea | 4048: e6 6f 75 82 04 0f 05 01 13 17 01 03 6f 64 64 74 .ou.........oddt | 4064: 68 72 61 15 03 0e 05 01 15 12 01 02 64 76 64 6e hra.........dvdn | 4080: 74 77 6f 02 00 00 00 00 00 00 00 00 00 00 00 00 two............. | page 3 offset 8192 | 2816: 00 00 00 00 00 00 00 00 00 00 00 06 03 02 01 00 ................ | 2832: c8 07 06 03 02 01 00 c7 11 06 03 02 01 02 a6 52 ...............R | 2848: 06 d5 02 01 10 c5 1b 06 03 02 00 ef c4 53 06 03 .............S.. | 2864: 02 01 00 c3 22 06 04 02 01 00 c2 26 06 03 02 01 ...........&.... | 2880: 00 c2 1e 02 b3 02 01 00 c0 3a 06 03 3c 01 00 bf .........:..<... | 2896: 2c 06 03 02 01 00 be 27 00 83 02 01 01 bd 15 06 ,......'........ | 2912: 03 02 01 00 bc 21 06 03 02 01 00 bb 54 16 13 02 .....!......T... | 2928: 01 09 9a 0a 06 03 02 01 00 b9 53 06 03 02 01 00 ..........S..... | 2944: b8 52 06 13 02 01 00 b7 1e 06 03 02 01 00 b6 34 .R.............4 | 2960: 06 13 02 01 00 b5 3a 05 f3 12 01 00 b4 45 05 03 ......:......E.. | 2976: 02 00 00 b4 6f 06 03 02 01 00 b2 03 06 03 02 01 ....o........... | 2992: 00 b1 63 06 03 02 01 00 b0 24 06 03 02 01 00 9f ..c......$...... | 3008: ac 06 03 02 01 00 a2 2f 07 03 02 01 01 ad 21 06 ......./......!. | 3024: 03 02 01 fb cd 5b 06 c0 01 f1 00 ab 23 06 03 02 .....[......#... | 3040: 01 00 aa 5b 06 03 02 01 00 a3 ce 06 02 03 01 00 ...[............ | 3056: a8 0e 06 03 02 01 00 a7 0c 06 02 f1 01 00 a6 0d ................ | 3072: 06 03 02 01 00 95 25 06 03 02 01 00 a4 17 06 03 ......%......... | 3088: 02 01 00 a3 09 06 03 02 01 00 a2 51 06 03 02 02 ...........Q.... | 3104: 00 a1 40 06 01 e2 00 00 a0 4b 06 13 02 00 00 9e ..@......K...... | 3120: 5d 06 03 02 01 10 9e 81 06 03 02 01 00 9d 42 06 ].............B. | 3136: 03 69 01 00 9c 48 06 03 02 01 00 9b 48 06 03 01 .i...H......H... | 3152: 01 00 9a 09 06 03 02 01 00 99 2f 06 03 02 01 00 ........../..... | 3168: 98 3a 06 03 02 01 00 97 24 06 03 02 01 00 96 4a .:......$......J | 3184: 06 03 02 11 00 f9 50 02 93 02 01 00 94 2f 06 03 ......P....../.. | 3200: 02 11 04 93 1a 06 03 01 04 e0 92 1a 06 03 02 01 ................ | 3216: 00 91 27 06 03 02 01 00 90 23 06 03 02 01 00 8f ..'......#...... | 3232: 3b 06 03 02 01 00 8e 46 06 16 02 01 00 8d 1d 07 ;......F........ | 3248: 23 12 01 00 8c 5a 06 03 02 01 00 8a 39 06 03 02 #....Z......9... | 3264: 00 ff 84 b5 06 03 02 01 00 89 07 06 03 02 11 00 ................ | 3280: 88 02 06 03 02 01 00 87 19 06 03 02 01 00 86 4d ...............M | 3296: 06 13 12 00 00 85 4b 06 03 02 01 00 84 37 06 13 ......K......7.. | 3312: 02 01 00 83 2c 06 03 02 01 00 81 60 06 13 02 11 ....,......`.... | 3328: 00 81 3b 06 03 02 01 0a b0 5a 06 03 01 01 7f 22 ..;......Z...... | 3344: 05 03 01 01 7e 21 05 03 01 01 7d 0b 15 03 01 02 ....~!.......... | 3360: 7b 08 05 03 06 91 7b 22 05 03 01 01 7a 58 05 03 ............zX.. | 3376: 01 01 7a 4f 05 03 01 01 78 49 05 03 01 01 77 16 ..zO....xI....w. | 3392: 05 03 01 01 76 5f 05 03 01 01 75 0f 05 03 01 01 ....v_....u..... | 3408: 74 2f 05 03 01 01 3f 1f 05 03 01 02 72 14 05 03 t/....?.....r... | 3424: 00 f1 71 08 05 03 01 01 70 0c 05 03 01 47 7f 29 ..q.....p....G.) | 3440: 05 03 01 01 6e 57 05 03 01 01 6d 33 05 13 00 f1 ....nW....m3.... | 3456: 6c 0b 05 03 01 01 6b 49 05 03 01 01 69 05 05 03 l.....kI....i... | 3472: 01 02 ed 23 00 00 01 00 00 00 00 00 00 00 00 00 ...#............ | end crash-40d5739835cbdb.db }]} {} ifcapable json1 { do_catchsql_test 18.1 { SELECT json_group_array(c) OVER win4 FROM t1 WINDOW win4 AS ( ORDER BY a COLLATE nocase RANGE BETWEEN 1.0 PRECEDING AND CURRENT ROW ) } {1 {JSON cannot hold BLOB values}} } ;# ifcapable json1 #------------------------------------------------------------------------- reset_db do_test 19.0 { sqlite3 db {} db deserialize [decode_hexdb { .open --hexdb | size 20480 pagesize 4096 filename crash-f022eb0ce64d27.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 05 .....@ ........ | 32: 00 00 00 00 00 00 00 00 00 00 00 02 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 0f f8 00 04 0e d2 00 0f 08 0f d3 ................ | 112: 0f ae 0e d2 00 00 00 00 00 00 00 00 00 00 00 00 ................ | 3792: 00 00 34 04 06 17 0f 11 01 57 69 6e 64 65 78 61 ..4......Windexa | 3808: 74 31 05 43 52 45 41 54 45 20 55 4e 49 51 55 45 t1.CREATE UNIQUE | 3824: 20 49 4e 44 45 58 20 61 20 4f 4e 20 74 31 28 61 INDEX a ON t1(a | 3840: 2c 20 30 20 7c 20 61 29 81 23 01 07 17 11 11 01 , 0 | a).#...... | 3856: 82 31 74 61 62 6c 65 74 31 74 31 02 43 52 45 41 .1tablet1t1.CREA | 3872: 54 45 20 54 41 42 4c 45 20 74 31 28 0a 20 20 20 TE TABLE t1(. | 3888: 20 67 63 62 20 41 53 20 28 62 2a 31 29 2c 0a 20 gcb AS (b*1),. | 3904: 20 20 20 61 20 49 34 54 45 47 45 52 20 50 52 49 a I4TEGER PRI | 3920: 4d 41 52 59 20 4b 45 59 2c 0a 20 20 20 20 67 63 MARY KEY,. gc | 3936: 63 20 41 53 20 28 74 32 2b 30 29 2c 0a 20 20 20 c AS (t2+0),. | 3952: 20 62 20 55 4e 49 51 55 45 2c 0a 20 20 20 20 67 b UNIQUE,. g | 3968: 63 61 20 41 53 20 28 31 2a 61 2b 30 29 2c 0a 20 ca AS (1*a+0),. | 3984: 20 20 20 74 32 20 55 4e 49 51 55 45 0a 20 20 29 t2 UNIQUE. ) | 4000: 20 57 49 54 48 4f 55 54 20 52 4f 57 49 44 23 03 WITHOUT ROWID#. | 4016: 06 17 37 11 01 00 69 6e 64 65 78 73 71 6c 69 74 ..7...indexsqlit | 4032: 65 5f 61 75 74 6f 69 6e 64 65 78 5f 74 31 5f 33 e_autoindex_t1_3 | 4048: 74 31 02 23 02 06 17 37 11 01 00 69 6e 64 65 78 t1.#...7...index | 4064: 73 71 6c 69 74 65 5f 61 75 74 6f 69 6e 64 65 78 sqlite_autoindex | 4080: 5f 74 31 5f 32 74 31 02 00 00 00 08 00 00 00 00 _t1_2t1......... | page 2 offset 4096 | 0: 0a 00 00 00 05 0f d8 00 0f f8 0f f8 9f e8 0f e0 ................ | 16: 0f d8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ | 4048: 00 00 00 00 00 00 00 00 07 04 01 02 00 0f 13 88 ................ | 4064: 07 04 01 02 00 0e 0f a0 07 04 01 02 00 0d 0b b8 ................ | 4080: 07 04 01 02 00 0c 07 d0 07 04 01 02 00 0b 03 e8 ................ | page 5 offset 16384 | 0: 0a 00 00 00 05 0f e2 00 0f fa 0f f4 0f ee 0f e8 ................ | 16: 0f e2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ | 4064: 00 00 05 03 01 01 0f 0f 05 03 01 01 0e 0e 05 03 ................ | 4080: 01 01 0d 0d 05 03 01 01 0c 0c 05 03 01 01 0b 0b ................ | end crash-f022eb0ce64d27.db }]} {} do_execsql_test 19.1 { PRAGMA writable_schema=ON; } do_catchsql_test 19.2 { UPDATE t1 SET a=1; } {1 {database disk image is malformed}} reset_db do_execsql_test 19.3 { CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INTEGER, d TEXT); CREATE INDEX i1 ON t1((NULL)); INSERT INTO t1 VALUES(1, NULL, 1, 'text value'); PRAGMA writable_schema = on; UPDATE sqlite_schema SET sql = 'CREATE INDEX i1 ON t1(b, c, d)', tbl_name = 't1', type='index' WHERE name='i1'; } db close sqlite3 db test.db do_catchsql_test 19.4 { PRAGMA integrity_check; } {1 {database disk image is malformed}} finish_test