SQLite

Check-in [b7bec7f2d3]
Login

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

Overview
Comment:Fix test script temptable2.test so that it works with the "inmemory_journal" and "journaltest" permutations.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | tempfiles-25
Files: files | file ages | folders
SHA1: b7bec7f2d3d08d0c14f77654be2c5cedf1619e58
User & Date: dan 2016-04-29 14:12:48.901
Context
2016-04-29
15:39
Postpone I/O associated with TEMP files for as long as possible, with the hope that the I/O can ultimately be avoided completely. (check-in: 9d0a5ae002 user: drh tags: trunk)
14:12
Fix test script temptable2.test so that it works with the "inmemory_journal" and "journaltest" permutations. (Closed-Leaf check-in: b7bec7f2d3 user: dan tags: tempfiles-25)
11:35
Merge latest trunk changes, including test case fixes, with this branch. (check-in: 99794aca7b user: dan tags: tempfiles-25)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/temptable2.test.
135
136
137
138
139
140
141


142
143
144
145
146
147
148
149
150
151
  INSERT INTO t2 SELECT randomblob(100), randomblob(100) FROM x;

  CREATE TEMP TABLE t1(a, b);
  CREATE INDEX i1 ON t1(a, b);
  INSERT INTO t1 VALUES(1, 2);
}



do_test 5.1.2 {
  set n [db one { PRAGMA temp.page_count }]
  expr ($n > 280 && $n < 290)
} {1}

do_execsql_test 5.1.3 {
  BEGIN;
    UPDATE t1 SET a=2;
    UPDATE t2 SET a=randomblob(100);
    SELECT count(*) FROM t1;







>
>


|







135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
  INSERT INTO t2 SELECT randomblob(100), randomblob(100) FROM x;

  CREATE TEMP TABLE t1(a, b);
  CREATE INDEX i1 ON t1(a, b);
  INSERT INTO t1 VALUES(1, 2);
}

# Test that the temp database is now much bigger than the configured
# cache size (10 pages).
do_test 5.1.2 {
  set n [db one { PRAGMA temp.page_count }]
  expr ($n > 270 && $n < 290)
} {1}

do_execsql_test 5.1.3 {
  BEGIN;
    UPDATE t1 SET a=2;
    UPDATE t2 SET a=randomblob(100);
    SELECT count(*) FROM t1;
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
} {
  reset_db
  sqlite3 db ""
  do_execsql_test 9.$tn.1.1 {
    PRAGMA cache_size = 15;
    PRAGMA auto_vacuum = 1;
  }
  do_execsql_test 9.$tn.1.2 "PRAGMA journal_mode = $mode" delete

  do_execsql_test 9.$tn.1.3 {
    CREATE TABLE tx(a, b);
    CREATE INDEX i1 ON tx(a);
    CREATE INDEX i2 ON tx(b);
    WITH x(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM x WHERE i<1000 )
      INSERT INTO tx SELECT randomblob(100), randomblob(100) FROM x;
  }








|

|







282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
} {
  reset_db
  sqlite3 db ""
  do_execsql_test 9.$tn.1.1 {
    PRAGMA cache_size = 15;
    PRAGMA auto_vacuum = 1;
  }
  execsql "PRAGMA journal_mode = $mode"

  do_execsql_test 9.$tn.1.2 {
    CREATE TABLE tx(a, b);
    CREATE INDEX i1 ON tx(a);
    CREATE INDEX i2 ON tx(b);
    WITH x(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM x WHERE i<1000 )
      INSERT INTO tx SELECT randomblob(100), randomblob(100) FROM x;
  }

337
338
339
340
341
342
343



344

345
346
347
348
349
350
351
  BEGIN;
    WITH x(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM x WHERE i<500 )
      INSERT INTO t1 SELECT randomblob(100), randomblob(100) FROM x;
  COMMIT;
  INSERT INTO t2 VALUES(3, 4);
}




do_execsql_test 10.2 {

  PRAGMA mmap_size = 512000;
  SELECT * FROM t2;
  PRAGMA integrity_check;
} {512000 1 2 3 4 ok}

finish_test








>
>
>
|
>
|
|
|
<



339
340
341
342
343
344
345
346
347
348
349
350
351
352
353

354
355
356
  BEGIN;
    WITH x(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM x WHERE i<500 )
      INSERT INTO t1 SELECT randomblob(100), randomblob(100) FROM x;
  COMMIT;
  INSERT INTO t2 VALUES(3, 4);
}

if {[permutation]!="journaltest"} {
  # The journaltest permutation does not support mmap, so this part of
  # the test is omitted.
  do_execsql_test 10.2 { PRAGMA mmap_size = 512000 } 512000
}

do_execsql_test 10.3 { SELECT * FROM t2 } {1 2 3 4}
do_execsql_test 10.4 { PRAGMA integrity_check } ok


finish_test