/ Check-in [197edb23]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add test case for the previous commit.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 197edb235b785c68fda7be788efbc61137d9452886599415a927b959ade93c65
User & Date: dan 2019-01-30 18:47:35
Context
2019-01-30
19:12
When parsing the schema, check for duplicate index root page numbers before adding the index to the schema hash table. check-in: 6b360bc0 user: dan tags: trunk
18:47
Add test case for the previous commit. check-in: 197edb23 user: dan tags: trunk
18:33
Detect if two indexes of the same table share a common rootpage while parsing the schema, and throw an error immediately. check-in: f21c6f13 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/corruptL.test.

   574    574     DROP INDEX t1x2;
   575    575   } {0 {}}
   576    576   
   577    577   do_catchsql_test 5.3 {
   578    578     INSERT INTO t1(b) VALUES(zeroblob(40000));
   579    579   } {1 {database disk image is malformed}}
   580    580   
          581  +#-------------------------------------------------------------------------
          582  +reset_db
          583  +do_test 6.0 {
          584  +  sqlite3 db {}
          585  +  db deserialize [decode_hexdb {
          586  +| size 20480 pagesize 4096 filename crash-d260f001fa015c.db
          587  +| page 1 offset 0
          588  +|      0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00   SQLite format 3.
          589  +|     16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 05   .....@  ........
          590  +|     32: 00 00 00 00 00 ff ff f0 00 00 00 02 00 00 00 04   ................
          591  +|     48: 00 00 00 00 00 00 00 64 00 00 00 01 00 00 00 00   .......d........
          592  +|     96: 00 00 00 00 0d 0f f8 00 04 0e ce 00 0f 4c 0f d3   .............L..
          593  +|    112: 0e fa 0e ce 00 00 00 00 00 00 00 00 00 00 00 00   ................
          594  +|   3776: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2a 04   ..............*.
          595  +|   3792: 06 17 13 11 01 3f 69 6e 64 65 78 74 31 62 74 31   .....?indext1bt1
          596  +|   3808: 05 43 52 45 41 54 45 20 49 4e 44 45 58 20 74 31   .CREATE INDEX t1
          597  +|   3824: 62 20 4f 4e 20 74 31 28 62 29 50 03 06 17 2b 2b   b ON t1(b)P...++
          598  +|   3840: 01 59 74 61 62 6c 65 73 71 6c 69 74 65 5f 73 65   .Ytablesqlite_se
          599  +|   3856: 71 75 65 6e 63 65 73 71 6c 69 74 65 5f 73 65 71   quencesqlite_seq
          600  +|   3872: 75 65 6e 63 65 04 43 52 45 41 54 45 20 54 41 42   uence.CREATE TAB
          601  +|   3888: 4c 45 20 73 71 6c 69 74 65 5f 73 65 71 75 65 6e   LE sqlite_sequen
          602  +|   3904: 63 65 28 6e 61 6d 65 2c 73 65 71 29 81 04 01 07   ce(name,seq)....
          603  +|   3920: 17 11 11 01 81 73 74 61 c2 6c 65 74 31 74 31 02   .....sta.let1t1.
          604  +|   3936: 43 52 45 41 54 45 20 54 41 42 4c 45 20 74 31 28   CREATE TABLE t1(
          605  +|   3952: 61 20 52 45 41 4c 20 4e 4f 54 20 4e 55 4c 4c 20   a REAL NOT NULL 
          606  +|   3968: 44 45 46 41 55 4c 54 28 32 35 2b 33 32 29 2c 62   DEFAULT(25+32),b
          607  +|   3984: 20 46 4c 4f 41 54 2c 63 20 44 4f 55 42 4c 45 20    FLOAT,c DOUBLE 
          608  +|   4000: 55 4e 49 51 55 45 2c 0a 64 20 43 4c 4f 42 2c 65   UNIQUE,.d CLOB,e
          609  +|   4016: 20 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52 59    INTEGER PRIMARY
          610  +|   4032: 20 4b 45 59 20 41 55 54 4f 49 4e 43 52 45 4d 45    KEY AUTOINCREME
          611  +|   4048: 4e 54 29 23 02 06 17 37 11 01 00 69 6e 64 65 78   NT)#...7...index
          612  +|   4064: 73 71 6c 69 74 65 5f 61 75 74 6f 69 6e 64 65 78   sqlite_autoindex
          613  +|   4080: 5f 74 31 5f 31 74 31 05 00 00 00 08 00 00 00 00   _t1_1t1.........
          614  +| page 2 offset 4096
          615  +|      0: 0d 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00   ................
          616  +| page 3 offset 8192
          617  +|      0: 0a 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00   ................
          618  +| page 4 offset 12288
          619  +|      0: 0d 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00   ................
          620  +| page 5 offset 16384
          621  +|      0: 0a 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00   ................
          622  +| end crash-d260f001fa015c.db
          623  +}]} {}
   581    624   
          625  +do_catchsql_test 6.1 {
          626  +  BEGIN;
          627  +    INSERT INTO t1(b) VALUES(1);
          628  +    INSERT INTO t1(b) VALUES(2);
          629  +  COMMIT;
          630  +} {1 {malformed database schema (t1b) - invalid root page}}
   582    631   
   583    632   finish_test