dan | c00727a | 2021-05-24 14:35:19 +0000 | [diff] [blame] | 1 | # 2021 May 24 |
| 2 | # |
| 3 | # The author disclaims copyright to this source code. In place of |
| 4 | # a legal notice, here is a blessing: |
| 5 | # |
| 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. |
| 9 | # |
| 10 | #*********************************************************************** |
| 11 | # Tests focused on the in-memory journal. |
| 12 | # |
| 13 | |
| 14 | set testdir [file dirname $argv0] |
| 15 | source $testdir/tester.tcl |
| 16 | source $testdir/malloc_common.tcl |
| 17 | set testprefix memjournal |
| 18 | |
| 19 | |
| 20 | do_execsql_test 1.0 { |
| 21 | PRAGMA journal_mode = memory; |
| 22 | CREATE TABLE t1(a); |
| 23 | } {memory} |
| 24 | |
| 25 | set nRow [expr 1] |
| 26 | |
| 27 | do_execsql_test 1.1 { |
| 28 | BEGIN; |
| 29 | INSERT INTO t1 VALUES( randomblob(500) ); |
| 30 | } {} |
| 31 | |
| 32 | do_test 1.2 { |
| 33 | for {set i 1} {$i <= 500} {incr i} { |
| 34 | execsql { |
| 35 | SAVEPOINT one; |
| 36 | UPDATE t1 SET a=randomblob(500); |
| 37 | } |
| 38 | execsql { SAVEPOINT abc } |
| 39 | execsql { UPDATE t1 SET a=randomblob(500) WHERE rowid<=$i AND 0 } |
| 40 | execsql { RELEASE abc } |
| 41 | } |
| 42 | } {} |
| 43 | |
| 44 | do_execsql_test 1.3 { |
| 45 | COMMIT; |
| 46 | } |
| 47 | |
| 48 | finish_test |