/ Check-in [4371a0c4]
Login

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

Overview
Comment:Update test file dbfuzz001.test so that it works with SQLITE_ENABLE_OVERSIZE_CELL_CHECK builds.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:4371a0c46ee7bfbc0a1507796bd9eefd3371adad81b8dda214d018854316727b
User & Date: dan 2019-02-06 18:08:42
References
2019-04-13
15:07
Partially revert the test file changes in [4371a0c46e]. It is no longer required following [93ae382e97c23c90]. check-in: 593a7e6e user: dan tags: trunk
Context
2019-02-06
19:42
Avoid attempting to delete a file while it is still open in walfault2.test. check-in: 9d54a63d user: dan tags: trunk
18:08
Update test file dbfuzz001.test so that it works with SQLITE_ENABLE_OVERSIZE_CELL_CHECK builds. check-in: 4371a0c4 user: dan tags: trunk
15:23
Add -DSQLITE_ENABLE_DESERIALIZE to the default testing configuration in test/releasetest.tcl. check-in: 433d6ef6 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/dbfuzz001.test.

   164    164       |    432: 01 ec 01 c5 01 0d 43 00 00 48 01 54 00 01 f7 01   ......C..H.T....
   165    165       |    448: ec 01 c5 01 0d 42 00 00 48 01 54 00 01 f7 01 ec   .....B..H.T.....
   166    166       |    464: 01 c5 01 0d 41 00 00 48 01 54 00 01 f7 01 ec 01   ....A..H.T......
   167    167       |    480: c5 01 0d 40 00 00 48 01 54 00 01 f7 01 ec 01 c5   ...@..H.T.......
   168    168       |    496: 01 0d 3f 00 00 48 01 54 00 01 f7 01 ec 01 c5 01   ..?..H.T........
   169    169       | end c4.db
   170    170     }]
   171         -  db eval {PRAGMA writable_schema=on; PRAGMA integrity_check}
   172         -} {/Fragmentation of 384 bytes reported as 0 on page 8/}
          171  +} {}
          172  +
          173  +ifcapable !oversize_cell_check {
          174  +  # Non SQLITE_ENABLE_OVERSIZE_CELL_CHECK builds:
          175  +  do_test dbfuzz001-101a {
          176  +    db eval {PRAGMA writable_schema=on; PRAGMA integrity_check}
          177  +  } {/Fragmentation of 384 bytes reported as 0 on page 8/}
          178  +} else {
          179  +  # SQLITE_ENABLE_OVERSIZE_CELL_CHECK builds:
          180  +  do_catchsql_test dbfuzz001-101b {
          181  +    PRAGMA writable_schema=on; 
          182  +    PRAGMA integrity_check;
          183  +  } {1 {database disk image is malformed}}
          184  +}
   173    185   
   174    186   # The DELETE query below deletes the very last cell from page 8.
   175    187   # Prior to a certain fix to sqlite3BtreeDelete() and because of the
   176    188   # corruption to the freeblock list on page 8, this would fail to
   177    189   # cause a rebalance operation, which would leave the btree in a weird
   178    190   # state that would lead to segfaults and or assertion faults.
   179    191   #
   180         -do_execsql_test dbfuzz001-110 {
          192  +set res {0 {}}
          193  +ifcapable oversize_cell_check { set res {1 {database disk image is malformed}} }
          194  +do_catchsql_test dbfuzz001-110 {
   181    195     DELETE FROM t3 WHERE x IS NOT NULL AND +rowid=6;
   182         -} {}
          196  +} $res
   183    197   
   184    198   # This is a dbfuzz2-generate test case that can cause a page with
   185    199   # pPage->nCell==0 to enter the balancer.
   186    200   #
   187    201   do_test dbfuzz001-200 {
   188    202     db deserialize [decode_hexdb {
   189    203       | size 3076 pagesize 512 filename c03.db
................................................................................
   266    280       |    496: 07 40 18 00 04 02 01 04 03 03 02 01 04 03 02 02   .@..............
   267    281       | end x/c03.db
   268    282     }]
   269    283     catchsql {INSERT INTO t3 SELECT * FROM t2;}
   270    284   } {1 {database disk image is malformed}}
   271    285   
   272    286   
   273         -do_test dbfuzz001-110 {
          287  +do_test dbfuzz001-310 {
   274    288     sqlite3 db {}
   275    289     db deserialize [decode_hexdb {
   276    290   | size 3584 pagesize 512 filename x/c02.db
   277    291   | page 1 offset 0
   278    292   |      0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00   SQLite format 3.
   279    293   |     16: 02 00 01 01 00 40 20 20 00 00 00 0c 00 00 00 07   .....@  ........
   280    294   |     32: 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 04   ................
................................................................................
   345    359   |    464: 69 67 68 74 0a 06 02 07 40 18 00 00 00 00 00 00   ight....@.......
   346    360   |    480: 0a 05 02 07 40 18 00 00 00 00 00 00 03 04 02 01   ....@...........
   347    361   |    496: 04 03 03 02 01 04 03 02 02 01 02 03 01 02 01 02   ................
   348    362   | end x/c02.db
   349    363     }]
   350    364   } {}
   351    365   
   352         -do_catchsql_test dbfuzz001-120 {
          366  +do_catchsql_test dbfuzz001-320 {
   353    367     PRAGMA integrity_check;
   354    368   } {1 {database disk image is malformed}}
   355    369   
   356         -do_catchsql_test dbfuzz001-130 {
          370  +do_catchsql_test dbfuzz001-330 {
   357    371     DELETE FROM t3 WHERE x IN (SELECT x FROM t4);
   358    372   } {1 {database disk image is malformed}}
   359    373   
   360    374   finish_test