| OLD | NEW |
| 1 # 2013-11-04 | 1 # 2013-11-04 |
| 2 # | 2 # |
| 3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
| 4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
| 5 # | 5 # |
| 6 # May you do good and not evil. | 6 # May you do good and not evil. |
| 7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
| 8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
| 9 # | 9 # |
| 10 #*********************************************************************** | 10 #*********************************************************************** |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 # cmd An UPDATE command to execute against table t1 | 280 # cmd An UPDATE command to execute against table t1 |
| 281 # t0 True if there is an error from $cmd | 281 # t0 True if there is an error from $cmd |
| 282 # t1 Content of "b" column of t1 assuming no error in $cmd | 282 # t1 Content of "b" column of t1 assuming no error in $cmd |
| 283 # t2 Content of "x" column of t3 | 283 # t2 Content of "x" column of t3 |
| 284 # t3 Number of temporary files for tables | 284 # t3 Number of temporary files for tables |
| 285 # t4 Number of temporary files for statement journals | 285 # t4 Number of temporary files for statement journals |
| 286 # | 286 # |
| 287 # Update: Since temporary table files are now opened lazily, and none | 287 # Update: Since temporary table files are now opened lazily, and none |
| 288 # of the following tests use large quantities of data, t3 is always 0. | 288 # of the following tests use large quantities of data, t3 is always 0. |
| 289 # | 289 # |
| 290 # Update (2016-03-04): Subjournals now only open when their size |
| 291 # exceeds 64KB. |
| 292 # |
| 290 foreach {i conf1 cmd t0 t1 t2 t3 t4} { | 293 foreach {i conf1 cmd t0 t1 t2 t3 t4} { |
| 291 1 {} UPDATE 1 {6 7 8 9} 1 0 1 | 294 1 {} UPDATE 1 {6 7 8 9} 1 0 0 |
| 292 2 REPLACE UPDATE 0 {7 6 9} 1 0 1 | 295 2 REPLACE UPDATE 0 {7 6 9} 1 0 0 |
| 293 3 IGNORE UPDATE 0 {6 7 3 9} 1 0 1 | 296 3 IGNORE UPDATE 0 {6 7 3 9} 1 0 0 |
| 294 4 FAIL UPDATE 1 {6 7 3 4} 1 0 1 | 297 4 FAIL UPDATE 1 {6 7 3 4} 1 0 0 |
| 295 5 ABORT UPDATE 1 {1 2 3 4} 1 0 1 | 298 5 ABORT UPDATE 1 {1 2 3 4} 1 0 0 |
| 296 6 ROLLBACK UPDATE 1 {1 2 3 4} 0 0 1 | 299 6 ROLLBACK UPDATE 1 {1 2 3 4} 0 0 0 |
| 297 7 REPLACE {UPDATE OR IGNORE} 0 {6 7 3 9} 1 0 0 | 300 7 REPLACE {UPDATE OR IGNORE} 0 {6 7 3 9} 1 0 0 |
| 298 8 IGNORE {UPDATE OR REPLACE} 0 {7 6 9} 1 0 1 | 301 8 IGNORE {UPDATE OR REPLACE} 0 {7 6 9} 1 0 0 |
| 299 9 FAIL {UPDATE OR IGNORE} 0 {6 7 3 9} 1 0 0 | 302 9 FAIL {UPDATE OR IGNORE} 0 {6 7 3 9} 1 0 0 |
| 300 10 ABORT {UPDATE OR REPLACE} 0 {7 6 9} 1 0 1 | 303 10 ABORT {UPDATE OR REPLACE} 0 {7 6 9} 1 0 0 |
| 301 11 ROLLBACK {UPDATE OR IGNORE} 0 {6 7 3 9} 1 0 0 | 304 11 ROLLBACK {UPDATE OR IGNORE} 0 {6 7 3 9} 1 0 0 |
| 302 12 {} {UPDATE OR IGNORE} 0 {6 7 3 9} 1 0 0 | 305 12 {} {UPDATE OR IGNORE} 0 {6 7 3 9} 1 0 0 |
| 303 13 {} {UPDATE OR REPLACE} 0 {7 6 9} 1 0 1 | 306 13 {} {UPDATE OR REPLACE} 0 {7 6 9} 1 0 0 |
| 304 14 {} {UPDATE OR FAIL} 1 {6 7 3 4} 1 0 0 | 307 14 {} {UPDATE OR FAIL} 1 {6 7 3 4} 1 0 0 |
| 305 15 {} {UPDATE OR ABORT} 1 {1 2 3 4} 1 0 1 | 308 15 {} {UPDATE OR ABORT} 1 {1 2 3 4} 1 0 0 |
| 306 16 {} {UPDATE OR ROLLBACK} 1 {1 2 3 4} 0 0 0 | 309 16 {} {UPDATE OR ROLLBACK} 1 {1 2 3 4} 0 0 0 |
| 307 } { | 310 } { |
| 308 | 311 |
| 309 # When using in-memory journals, no temporary files are required for | 312 # When using in-memory journals, no temporary files are required for |
| 310 # statement journals. | 313 # statement journals. |
| 311 if {[permutation] == "inmemory_journal"} { set t4 0 } | 314 if {[permutation] == "inmemory_journal"} { set t4 0 } |
| 312 | 315 |
| 313 if {$t0} {set t1 {UNIQUE constraint failed: t1.a}} | 316 if {$t0} {set t1 {UNIQUE constraint failed: t1.a}} |
| 314 if {[info exists TEMP_STORE] && $TEMP_STORE==3} { | 317 if {[info exists TEMP_STORE] && $TEMP_STORE==3} { |
| 315 set t3 0 | 318 set t3 0 |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 CREATE UNIQUE INDEX t1xy ON t1(x,y); | 849 CREATE UNIQUE INDEX t1xy ON t1(x,y); |
| 847 REPLACE INTO t1(x,y,z) VALUES('alpha','gamma',1); | 850 REPLACE INTO t1(x,y,z) VALUES('alpha','gamma',1); |
| 848 PRAGMA integrity_check; | 851 PRAGMA integrity_check; |
| 849 SELECT x,y FROM t1 INDEXED BY t1xy; | 852 SELECT x,y FROM t1 INDEXED BY t1xy; |
| 850 SELECT x,y,z FROM t1 NOT INDEXED; | 853 SELECT x,y,z FROM t1 NOT INDEXED; |
| 851 } {ok alpha gamma alpha gamma 1} | 854 } {ok alpha gamma alpha gamma 1} |
| 852 | 855 |
| 853 | 856 |
| 854 | 857 |
| 855 finish_test | 858 finish_test |
| OLD | NEW |