/ Check-in [9f452514]
Login

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

Overview
Comment:Fix an assert() failure in wal2.test caused by messing with the contents of shared memory.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9f452514d96ab8d424eadc55c283c53fe831476d
User & Date: dan 2010-07-14 18:10:03
Context
2010-07-14
18:24
Make the result of an IN or NOT IN expression with an empty set on the right-hand side always either false or true, respectively, even if the left-hand side is NULL. Ticket [80e031a00f45dc] check-in: c288ac64 user: drh tags: trunk
18:10
Fix an assert() failure in wal2.test caused by messing with the contents of shared memory. check-in: 9f452514 user: dan tags: trunk
16:37
Test the libraries response to read-only or unreadable database, WAL and wal-index files. If a WAL file cannot be opened in read/write mode, return SQLITE_CANTOPEN to the caller. check-in: 45bb84c6 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/wal2.test.

   975    975     }
   976    976   } {wal 1 2 3 4 5 6 7 8 9}
   977    977   
   978    978   do_test wal2-11.1.1 {
   979    979     sqlite3 db2 test.db
   980    980     execsql { SELECT name FROM sqlite_master } db2
   981    981   } {t1}
          982  +
          983  +# Set all zeroed slots in the first hash table to invalid values.
          984  +#
          985  +set blob [string range [tvfs shm $::filename] 0 16383]
          986  +set I [string range [tvfs shm $::filename] 16384 end]
          987  +binary scan $I t* L
          988  +set I [list]
          989  +foreach p $L {
          990  +  lappend I [expr $p ? $p : 400]
          991  +}
          992  +append blob [binary format t* $I]
          993  +tvfs shm $::filename $blob
          994  +do_test wal2-11.2 {
          995  +  catchsql { INSERT INTO t1 VALUES(10, 11, 12) }
          996  +} {1 {database disk image is malformed}}
   982    997   
   983    998   # Fill up the hash table on the first page of shared memory with 0x55 bytes.
   984    999   #
   985   1000   set blob [string range [tvfs shm $::filename] 0 16383]
   986         -append blob [string repeat [binary format c 0x55] 16384]
         1001  +append blob [string repeat [binary format c 55] 16384]
   987   1002   tvfs shm $::filename $blob
   988         -
   989         -do_test wal2-11.2 {
         1003  +do_test wal2-11.3 {
   990   1004     catchsql { SELECT * FROM t1 } db2
   991   1005   } {1 {database disk image is malformed}}
   992   1006   
   993         -do_test wal2-12.1 {
   994         -  catchsql { INSERT INTO t1 VALUES(10, 11, 12) }
   995         -} {1 {database disk image is malformed}}
   996         -
   997   1007   db close
   998   1008   db2 close
   999   1009   tvfs delete
  1000   1010   
  1001   1011   #-------------------------------------------------------------------------
  1002   1012   # If a connection is required to create a WAL or SHM file, it creates 
  1003   1013   # the new files with the same file-system permissions as the database