/ Check-in [016486c7]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Modify wal2.test to disable tests requiring TCL 8.5 if the test harness is compiled using TCL 8.4.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 016486c7d544dcf9b7422cb0fb9804aa1c418f68
User & Date: drh 2010-08-02 10:59:14
Context
2010-08-03
13:08
Fix the REPLACE conflict resolution so that it falls back to ABORT when a CHECK constraint fails. Ticket [c38baa3d969eab794]. check-in: 4e157b77 user: drh tags: trunk
2010-08-02
10:59
Modify wal2.test to disable tests requiring TCL 8.5 if the test harness is compiled using TCL 8.4. check-in: 016486c7 user: drh tags: trunk
10:47
In shared-cache mode, do not allow one connection to checkpoint a database while a second connection is reading or writing the same shared-cache. check-in: e75b52d1 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/wal2.test.

   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    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]
          983  +if {$::tcl_version>=8.5} {
          984  +  # Set all zeroed slots in the first hash table to invalid values.
          985  +  #
          986  +  set blob [string range [tvfs shm $::filename] 0 16383]
          987  +  set I [string range [tvfs shm $::filename] 16384 end]
          988  +  binary scan $I t* L
          989  +  set I [list]
          990  +  foreach p $L {
          991  +    lappend I [expr $p ? $p : 400]
          992  +  }
          993  +  append blob [binary format t* $I]
          994  +  tvfs shm $::filename $blob
          995  +  do_test wal2-11.2 {
          996  +    catchsql { INSERT INTO t1 VALUES(10, 11, 12) }
          997  +  } {1 {database disk image is malformed}}
          998  +  
          999  +  # Fill up the hash table on the first page of shared memory with 0x55 bytes.
         1000  +  #
         1001  +  set blob [string range [tvfs shm $::filename] 0 16383]
         1002  +  append blob [string repeat [binary format c 55] 16384]
         1003  +  tvfs shm $::filename $blob
         1004  +  do_test wal2-11.3 {
         1005  +    catchsql { SELECT * FROM t1 } db2
         1006  +  } {1 {database disk image is malformed}}
   991   1007   }
   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}}
   997         -
   998         -# Fill up the hash table on the first page of shared memory with 0x55 bytes.
   999         -#
  1000         -set blob [string range [tvfs shm $::filename] 0 16383]
  1001         -append blob [string repeat [binary format c 55] 16384]
  1002         -tvfs shm $::filename $blob
  1003         -do_test wal2-11.3 {
  1004         -  catchsql { SELECT * FROM t1 } db2
  1005         -} {1 {database disk image is malformed}}
  1006         -
         1008  +  
  1007   1009   db close
  1008   1010   db2 close
  1009   1011   tvfs delete
  1010   1012   
  1011   1013   #-------------------------------------------------------------------------
  1012   1014   # If a connection is required to create a WAL or SHM file, it creates 
  1013   1015   # the new files with the same file-system permissions as the database 
................................................................................
  1144   1146         } $b($can_read,$can_write)
  1145   1147       }
  1146   1148       catch { db close }
  1147   1149     }
  1148   1150   }
  1149   1151   
  1150   1152   finish_test
  1151         -