3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
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.
10 #***********************************************************************
12 # Crash tests for the multiplex module with 8.3 filenames enabled.
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
19 ifcapable !crashtest||!8_3_names {
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]
34 ATTACH 'file:test2.db?8_3_names=1' AS aux;
36 CREATE TABLE t1(x, y);
37 CREATE INDEX t1x ON t1(x);
38 CREATE INDEX t1y ON t1(y);
40 CREATE TABLE aux.t2(x, y);
41 CREATE INDEX aux.t2x ON t2(x);
42 CREATE INDEX aux.t2y ON t2(y);
45 SELECT 1 UNION ALL SELECT a+1 FROM s WHERE a<1000
47 INSERT INTO t1 SELECT a, randomblob(500) FROM s;
50 SELECT 1 UNION ALL SELECT a+1 FROM s WHERE a<1000
52 INSERT INTO t2 SELECT a, randomblob(500) FROM s;
55 for {set i 0} {$i < 20} {incr i} {
57 crashsql -delay 1 -file test1.db -opendb {
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]
64 ATTACH 'file:test2.db?8_3_names=1' AS aux;
66 UPDATE t1 SET y = randomblob(500) WHERE (x%10)==0;
67 UPDATE t2 SET y = randomblob(500) WHERE (x%10)==0;
70 } {1 {child process exited abnormally}}
72 do_execsql_test 2.$i.2 {
73 PRAGMA main.integrity_check;
74 PRAGMA aux.integrity_check;
79 sqlite3_multiplex_shutdown