/ Check-in [c6d0d441]
Login
Overview
Comment:Add tests for wal mode to temptable2.test.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tempfiles-lazy-open
Files: files | file ages | folders
SHA1:c6d0d441a1ab4873caedf2f23543444cea5d7f5a
User & Date: dan 2016-04-11 19:23:36
Context
2016-04-11
19:24
Fix a typo in temptable2.test. check-in: 04b1890f user: dan tags: tempfiles-lazy-open
19:23
Add tests for wal mode to temptable2.test. check-in: c6d0d441 user: dan tags: tempfiles-lazy-open
18:50
Merge latest trunk changes with this branch. check-in: ffc62af1 user: dan tags: tempfiles-lazy-open
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/temptable2.test.

268
269
270
271
272
273
274




275
276
277





278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295










296
297
298
299
300
301
302
303
304
305
306

307
308
309
310
} {SQLITE_READONLY}

tmp close

#-------------------------------------------------------------------------
# Try inserts and deletes with a large db in auto-vacuum mode. Check
#




reset_db
do_execsql_test 9.1 {
  PRAGMA cache_size = 15;





  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;
}
for {set i 2} {$i<20} {incr i} {

  do_execsql_test 9.$i.1 { DELETE FROM tx WHERE (random()%3)==0 }

  do_execsql_test 9.$i.2 { PRAGMA integrity_check } ok

  do_execsql_test 9.$i.3 { 
    WITH x(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM x WHERE i<400 )
      INSERT INTO tx SELECT randomblob(100), randomblob(100) FROM x;
  }











  do_execsql_test 9.$i.4 { PRAGMA integrity_check } ok

  do_execsql_test 9.$i.5 { 
    BEGIN;
      DELETE FROM tx WHERE (random()%3)==0;
      WITH x(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM x WHERE i<500 )
        INSERT INTO tx SELECT randomblob(100), randomblob(100) FROM x;
    COMMIT;
  }

  do_execsql_test 9.$i.6 { PRAGMA integrity_check } ok

}

finish_test








>
>
>
>
|
|
|
>
>
>
>
>
|
|
|
<
|
<
<
<
<
<
<
<
<
<
<



>
>
>
>
>
>
>
>
>
>
|

|
|



|
|

|
>




268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289

290










291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
} {SQLITE_READONLY}

tmp close

#-------------------------------------------------------------------------
# Try inserts and deletes with a large db in auto-vacuum mode. Check
#
foreach {tn mode} {
  1 delete
  2 wal
} {
  reset_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" $mode

  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;
  }

  for {set i 2} {$i<20} {incr i} {
    do_execsql_test 9.$tn.$i.1 { DELETE FROM tx WHERE (random()%3)==0 }

    do_execsql_test 9.$tn.$i.2 { PRAGMA integrity_check } ok

      do_execsql_test 9.$tn.$i.3 { 
        WITH x(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM x WHERE i<400 )
          INSERT INTO tx SELECT randomblob(100), randomblob(100) FROM x;
      }

    do_execsql_test 9.$tn.$i.4 { PRAGMA integrity_check } ok

    do_execsql_test 9.$tn.$i.5 { 
      BEGIN;
      DELETE FROM tx WHERE (random()%3)==0;
      WITH x(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM x WHERE i<500 )
        INSERT INTO tx SELECT randomblob(100), randomblob(100) FROM x;
      COMMIT;
    }

    do_execsql_test 9.$tn.$i.6 { PRAGMA integrity_check } ok
  }
}

finish_test