OLD | NEW |
1 # 2012 March 31 | 1 # 2012 March 31 |
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 SAVEPOINT x2; | 88 SAVEPOINT x2; |
89 CREATE TABLE t5(pqr); | 89 CREATE TABLE t5(pqr); |
90 INSERT INTO t2 VALUES($a,$b,$c); | 90 INSERT INTO t2 VALUES($a,$b,$c); |
91 ROLLBACK TO x2; | 91 ROLLBACK TO x2; |
92 } | 92 } |
93 } | 93 } |
94 } msg] | 94 } msg] |
95 list $rc $msg [db eval {SELECT * FROM t2}] | 95 list $rc $msg [db eval {SELECT * FROM t2}] |
96 } {1 {abort due to ROLLBACK} {}} | 96 } {1 {abort due to ROLLBACK} {}} |
97 | 97 |
| 98 # Ticket: https://www.sqlite.org/src/tktview/7f7f8026eda387d544b |
| 99 # Segfault in the in-memory journal logic triggered by a tricky |
| 100 # combination of SAVEPOINT operations. |
| 101 # |
| 102 unset -nocomplain i |
| 103 for {set i 248} {$i<=253} {incr i} { |
| 104 do_test savepoint7-3.$i { |
| 105 db close |
| 106 forcedelete test.db |
| 107 sqlite3 db test.db |
| 108 db eval { |
| 109 PRAGMA page_size=1024; |
| 110 PRAGMA temp_store=MEMORY; |
| 111 BEGIN; |
| 112 CREATE TABLE t1(x INTEGER PRIMARY KEY, y TEXT); |
| 113 WITH RECURSIVE c(x) AS (VALUES(1) UNION SELECT x+1 FROM c WHERE x<$::i) |
| 114 INSERT INTO t1(x,y) SELECT x*10, printf('%04d%.800c',x,'*') FROM c; |
| 115 SAVEPOINT one; |
| 116 SELECT count(*) FROM t1; |
| 117 WITH RECURSIVE c(x) AS (VALUES(1) UNION SELECT x+1 FROM c WHERE x<$::i) |
| 118 INSERT INTO t1(x,y) SELECT x*10+1, printf('%04d%.800c',x,'*') FROM c; |
| 119 ROLLBACK TO one; |
| 120 SELECT count(*) FROM t1; |
| 121 SAVEPOINT twoB; |
| 122 WITH RECURSIVE c(x) AS (VALUES(1) UNION SELECT x+1 FROM c WHERE x<10) |
| 123 INSERT INTO t1(x,y) SELECT x*10+2, printf('%04d%.800c',x,'*') FROM c; |
| 124 ROLLBACK TO twoB; |
| 125 RELEASE one; |
| 126 COMMIT; |
| 127 } |
| 128 } [list $i $i] |
| 129 } |
| 130 |
| 131 |
98 finish_test | 132 finish_test |
OLD | NEW |