SQLite

Check-in [ba8ca9c9e2]
Login

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

Overview
Comment:Changes to test scripts to work with SQLITE_TEMP_STORE=2.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ba8ca9c9e29e022dec0048dd655c35d54d5ef129
User & Date: dan 2010-09-20 14:55:34.000
Context
2010-09-20
19:17
Add test file e_update.test. (check-in: 03985ed4a0 user: dan tags: trunk)
14:55
Changes to test scripts to work with SQLITE_TEMP_STORE=2. (check-in: ba8ca9c9e2 user: dan tags: trunk)
14:05
Add further tests to e_insert.test. (check-in: eb3d0d8bb7 user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/backup.test.
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
  eval $zOpenScript

  # Set to true if copying to an in-memory destination. Copying to an 
  # in-memory destination is only possible if the initial destination
  # page size is the same as the source page size (in this case 1024 bytes).
  #
  set isMemDest [expr {
    $zDestFile eq ":memory:" || $file_dest eq "temp" && $TEMP_STORE==3
  }]

  if { $isMemDest==0 || $pgsz_dest == 1024 } {
    if 0 {
      puts -nonewline "Test $iTest: src=$zSrcFile dest=$zDestFile"
      puts -nonewline " (as $db_dest.$file_dest)"
      puts -nonewline " rows_dest=$rows_dest pgsz_dest=$pgsz_dest"







|







173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
  eval $zOpenScript

  # Set to true if copying to an in-memory destination. Copying to an 
  # in-memory destination is only possible if the initial destination
  # page size is the same as the source page size (in this case 1024 bytes).
  #
  set isMemDest [expr {
    $zDestFile eq ":memory:" || $file_dest eq "temp" && $TEMP_STORE>=2
  }]

  if { $isMemDest==0 || $pgsz_dest == 1024 } {
    if 0 {
      puts -nonewline "Test $iTest: src=$zSrcFile dest=$zDestFile"
      puts -nonewline " (as $db_dest.$file_dest)"
      puts -nonewline " rows_dest=$rows_dest pgsz_dest=$pgsz_dest"
Changes to test/conflict.test.
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
 12 {}       {UPDATE OR IGNORE}      0 {6 7 3 9}  1 0 0
 13 {}       {UPDATE OR REPLACE}     0 {7 6 9}    1 0 0
 14 {}       {UPDATE OR FAIL}        1 {6 7 3 4}  1 0 0
 15 {}       {UPDATE OR ABORT}       1 {1 2 3 4}  1 0 1
 16 {}       {UPDATE OR ROLLBACK}    1 {1 2 3 4}  0 0 0
} {
  if {$t0} {set t1 {column a is not unique}}
  if {[info exists TEMP_STORE] && $TEMP_STORE>=2} {
    set t3 0
  } else {
    set t3 [expr {$t3+$t4}]
  }
  do_test conflict-6.$i {
    db close
    sqlite3 db test.db 







|







303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
 12 {}       {UPDATE OR IGNORE}      0 {6 7 3 9}  1 0 0
 13 {}       {UPDATE OR REPLACE}     0 {7 6 9}    1 0 0
 14 {}       {UPDATE OR FAIL}        1 {6 7 3 4}  1 0 0
 15 {}       {UPDATE OR ABORT}       1 {1 2 3 4}  1 0 1
 16 {}       {UPDATE OR ROLLBACK}    1 {1 2 3 4}  0 0 0
} {
  if {$t0} {set t1 {column a is not unique}}
  if {[info exists TEMP_STORE] && $TEMP_STORE==3} {
    set t3 0
  } else {
    set t3 [expr {$t3+$t4}]
  }
  do_test conflict-6.$i {
    db close
    sqlite3 db test.db 
Changes to test/lock.test.
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
# retain a RESERVED or EXCLUSIVE lock after the transaction was committed:
# 
#   * The journal-mode is set to something other than 'delete', and
#   * there exists one or more active read-only statements, and
#   * a transaction that modified zero database pages is committed.
# 
set temp_status unlocked
if {$TEMP_STORE==3} {set temp_status unknown}
do_test lock-7.1 {
  set STMT [sqlite3_prepare $DB "SELECT * FROM sqlite_master" -1 TAIL]
  sqlite3_step $STMT
} {SQLITE_ROW}
do_test lock-7.2 {
  execsql { PRAGMA lock_status }
} [list main shared temp $temp_status]







|







394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
# retain a RESERVED or EXCLUSIVE lock after the transaction was committed:
# 
#   * The journal-mode is set to something other than 'delete', and
#   * there exists one or more active read-only statements, and
#   * a transaction that modified zero database pages is committed.
# 
set temp_status unlocked
if {$TEMP_STORE>=2} {set temp_status unknown}
do_test lock-7.1 {
  set STMT [sqlite3_prepare $DB "SELECT * FROM sqlite_master" -1 TAIL]
  sqlite3_step $STMT
} {SQLITE_ROW}
do_test lock-7.2 {
  execsql { PRAGMA lock_status }
} [list main shared temp $temp_status]
Changes to test/stmt.test.
31
32
33
34
35
36
37

38
39
40
41
42
43
44
  return
}
do_test stmt-1.2 {
  set sqlite_open_file_count
} {1}
do_test stmt-1.3 {
  execsql {

    BEGIN;
      INSERT INTO t1 VALUES(1, 1);
  }
  set sqlite_open_file_count
} {2}
do_test stmt-1.4 {
  execsql {







>







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
  return
}
do_test stmt-1.2 {
  set sqlite_open_file_count
} {1}
do_test stmt-1.3 {
  execsql {
    PRAGMA temp_store = file;
    BEGIN;
      INSERT INTO t1 VALUES(1, 1);
  }
  set sqlite_open_file_count
} {2}
do_test stmt-1.4 {
  execsql {
Changes to test/tempdb.test.
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
do_test tempdb-2.1 {
  # Set $::jrnl_in_memory if the journal file is expected to be in-memory.
  # Similarly, set $::subj_in_memory if the sub-journal file is expected
  # to be in memory. These variables are used to calculate the expected
  # number of open files in the test cases below.
  #
  set jrnl_in_memory [expr {[permutation] eq "inmemory_journal"}]
  set subj_in_memory [expr {$jrnl_in_memory || $TEMP_STORE == 3}]

  db close
  sqlite3 db test.db
} {}
do_test tempdb-2.2 {
  execsql {
    CREATE TABLE t1 (a PRIMARY KEY, b, c);







|







55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
do_test tempdb-2.1 {
  # Set $::jrnl_in_memory if the journal file is expected to be in-memory.
  # Similarly, set $::subj_in_memory if the sub-journal file is expected
  # to be in memory. These variables are used to calculate the expected
  # number of open files in the test cases below.
  #
  set jrnl_in_memory [expr {[permutation] eq "inmemory_journal"}]
  set subj_in_memory [expr {$jrnl_in_memory || $TEMP_STORE>=2}]

  db close
  sqlite3 db test.db
} {}
do_test tempdb-2.2 {
  execsql {
    CREATE TABLE t1 (a PRIMARY KEY, b, c);