| OLD | NEW |
| 1 # 2010 June 15 | 1 # 2010 June 15 |
| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 PRAGMA integrity_check; | 111 PRAGMA integrity_check; |
| 112 } [list $x ok] | 112 } [list $x ok] |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 db close | 116 db close |
| 117 tv delete | 117 tv delete |
| 118 | 118 |
| 119 | 119 |
| 120 #------------------------------------------------------------------------- | 120 #------------------------------------------------------------------------- |
| 121 # | |
| 122 # pager2-2.1: Test a ROLLBACK with journal_mode=off. | 121 # pager2-2.1: Test a ROLLBACK with journal_mode=off. |
| 123 # pager2-2.2: Test shrinking the database (auto-vacuum) with | 122 # pager2-2.2: Test shrinking the database (auto-vacuum) with |
| 124 # journal_mode=off | 123 # journal_mode=off |
| 125 # | 124 # |
| 126 do_test pager2-2.1 { | 125 do_test pager2-2.1 { |
| 127 faultsim_delete_and_reopen | 126 faultsim_delete_and_reopen |
| 128 execsql { | 127 execsql { |
| 129 CREATE TABLE t1(a, b); | 128 CREATE TABLE t1(a, b); |
| 130 PRAGMA journal_mode = off; | 129 PRAGMA journal_mode = off; |
| 131 BEGIN; | 130 BEGIN; |
| 132 INSERT INTO t1 VALUES(1, 2); | 131 INSERT INTO t1 VALUES(1, 2); |
| 133 ROLLBACK; | 132 ROLLBACK; |
| 134 SELECT * FROM t1; | 133 SELECT * FROM t1; |
| 135 } | 134 } |
| 136 } {off} | 135 } {off} |
| 137 do_test pager2-2.2 { | 136 do_test pager2-2.2 { |
| 138 faultsim_delete_and_reopen | 137 faultsim_delete_and_reopen |
| 139 execsql { | 138 execsql { |
| 140 PRAGMA auto_vacuum = incremental; | 139 PRAGMA auto_vacuum = incremental; |
| 141 PRAGMA page_size = 1024; | 140 PRAGMA page_size = 1024; |
| 142 PRAGMA journal_mode = off; | 141 PRAGMA journal_mode = off; |
| 143 CREATE TABLE t1(a, b); | 142 CREATE TABLE t1(a, b); |
| 144 INSERT INTO t1 VALUES(zeroblob(5000), zeroblob(5000)); | 143 INSERT INTO t1 VALUES(zeroblob(5000), zeroblob(5000)); |
| 145 DELETE FROM t1; | 144 DELETE FROM t1; |
| 146 PRAGMA incremental_vacuum; | 145 PRAGMA incremental_vacuum; |
| 147 } | 146 } |
| 148 file size test.db | 147 file size test.db |
| 149 } {3072} | 148 } {3072} |
| 150 | 149 |
| 150 #------------------------------------------------------------------------- |
| 151 # Test that shared in-memory databases seem to work. |
| 152 # |
| 153 db close |
| 154 do_test pager2-3.1 { |
| 155 forcedelete test.db |
| 156 sqlite3_shutdown |
| 157 sqlite3_config_uri 1 |
| 158 |
| 159 sqlite3 db1 {file:test.db?mode=memory&cache=shared} |
| 160 sqlite3 db2 {file:test.db?mode=memory&cache=shared} |
| 161 sqlite3 db3 test.db |
| 162 |
| 163 db1 eval { CREATE TABLE t1(a, b) } |
| 164 db2 eval { INSERT INTO t1 VALUES(1, 2) } |
| 165 list [catch { db3 eval { INSERT INTO t1 VALUES(3, 4) } } msg] $msg |
| 166 } {1 {no such table: t1}} |
| 167 |
| 151 finish_test | 168 finish_test |
| OLD | NEW |