/ Check-in [b8684df3]
Login

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

Overview
Comment:Disable multiplexing of master-journal files in the test_multiplex.c module.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b8684df395b5585a9428417c2bfd076515560f19
User & Date: dan 2015-03-12 19:12:30
Context
2015-03-12
21:22
When STAT4 is enabled, allow probes of the STAT4 table using the value of constant functions computed at compile-time. check-in: 0f250957 user: drh tags: trunk
19:12
Disable multiplexing of master-journal files in the test_multiplex.c module. check-in: b8684df3 user: dan tags: trunk
05:08
Improve the text on one of the opcode documentation comments in vdbe.c. check-in: 08958f57 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/test_multiplex.c.

   569    569       }
   570    570       if( rc==SQLITE_OK ){
   571    571         sqlite3_int64 sz;
   572    572   
   573    573         rc = pSubOpen->pMethods->xFileSize(pSubOpen, &sz);
   574    574         if( rc==SQLITE_OK && zName ){
   575    575           int bExists;
          576  +        if( flags & SQLITE_OPEN_MASTER_JOURNAL ){
          577  +          pGroup->bEnabled = 0;
          578  +        }else
   576    579           if( sz==0 ){
   577    580             if( flags & SQLITE_OPEN_MAIN_JOURNAL ){
   578    581               /* If opening a main journal file and the first chunk is zero
   579    582               ** bytes in size, delete any subsequent chunks from the 
   580    583               ** file-system. */
   581    584               int iChunk = 1;
   582    585               do {

Added test/crashM.test.

            1  +# 2015 Mar 13
            2  +#
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
            5  +#
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
            9  +#
           10  +#***********************************************************************
           11  +#
           12  +# Crash tests for the multiplex module with 8.3 filenames enabled.
           13  +#
           14  +
           15  +set testdir [file dirname $argv0]
           16  +source $testdir/tester.tcl
           17  +set testprefix crashM
           18  +
           19  +ifcapable !crashtest||!8_3_names {
           20  +  finish_test
           21  +  return
           22  +}
           23  +
           24  +db close
           25  +sqlite3_shutdown
           26  +sqlite3_config_uri 1
           27  +
           28  +foreach f [glob -nocomplain test1.* test2.*] { forcedelete $f }
           29  +sqlite3_multiplex_initialize "" 1
           30  +sqlite3 db file:test1.db?8_3_names=1
           31  +sqlite3_multiplex_control db main chunk_size [expr 64*1024]
           32  +
           33  +do_execsql_test 1.0 {
           34  +  ATTACH 'file:test2.db?8_3_names=1' AS aux;
           35  +
           36  +  CREATE TABLE t1(x, y);
           37  +  CREATE INDEX t1x ON t1(x);
           38  +  CREATE INDEX t1y ON t1(y);
           39  +
           40  +  CREATE TABLE aux.t2(x, y);
           41  +  CREATE INDEX aux.t2x ON t2(x);
           42  +  CREATE INDEX aux.t2y ON t2(y);
           43  +
           44  +  WITH s(a) AS (
           45  +    SELECT 1 UNION ALL SELECT a+1 FROM s WHERE a<1000
           46  +  )
           47  +  INSERT INTO t1 SELECT a, randomblob(500) FROM s;
           48  +
           49  +  WITH s(a) AS (
           50  +    SELECT 1 UNION ALL SELECT a+1 FROM s WHERE a<1000
           51  +  )
           52  +  INSERT INTO t2 SELECT a, randomblob(500) FROM s;
           53  +} {}
           54  +
           55  +for {set i 0} {$i < 20} {incr i} {
           56  +  do_test 2.$i.1 {
           57  +    crashsql -delay 1 -file test1.db -opendb {
           58  +      sqlite3_shutdown
           59  +      sqlite3_config_uri 1
           60  +      sqlite3_multiplex_initialize crash 1
           61  +      sqlite3 db file:test1.db?8_3_names=1
           62  +      sqlite3_multiplex_control db main chunk_size [expr 64*1024]
           63  +    } {
           64  +      ATTACH 'file:test2.db?8_3_names=1' AS aux;
           65  +      BEGIN;
           66  +        UPDATE t1 SET y = randomblob(500) WHERE (x%10)==0;
           67  +        UPDATE t2 SET y = randomblob(500) WHERE (x%10)==0;
           68  +      COMMIT;
           69  +    }
           70  +  } {1 {child process exited abnormally}}
           71  +
           72  +  do_execsql_test 2.$i.2 {
           73  +    PRAGMA main.integrity_check;
           74  +    PRAGMA aux.integrity_check;
           75  +  } {ok ok}
           76  +}
           77  +
           78  +catch { db close }
           79  +sqlite3_multiplex_shutdown
           80  +finish_test