OLD | NEW |
1 # 2009 January 30 | 1 # 2009 January 30 |
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 set rc [catch {sqlite3_backup B db2 temp db main}] | 77 set rc [catch {sqlite3_backup B db2 temp db main}] |
78 set errcode [sqlite3_errcode db2] | 78 set errcode [sqlite3_errcode db2] |
79 if {$rc && ($errcode == "SQLITE_NOMEM" || $errcode == "SQLITE_IOERR_NOMEM")} { | 79 if {$rc && ($errcode == "SQLITE_NOMEM" || $errcode == "SQLITE_IOERR_NOMEM")} { |
80 error "out of memory" | 80 error "out of memory" |
81 } | 81 } |
82 } -cleanup { | 82 } -cleanup { |
83 catch { B finish } | 83 catch { B finish } |
84 db2 close | 84 db2 close |
85 } | 85 } |
86 | 86 |
| 87 reset_db |
| 88 do_execsql_test 3.0 { |
| 89 PRAGMA page_size = 16384; |
| 90 BEGIN; |
| 91 CREATE TABLE t1(a, b); |
| 92 INSERT INTO t1 VALUES(1, 2); |
| 93 COMMIT; |
| 94 } |
| 95 |
| 96 do_faultsim_test 3 -faults oom* -prep { |
| 97 catch { db close } |
| 98 catch { db2 close } |
| 99 |
| 100 forcedelete test2.db |
| 101 sqlite3 db2 test2.db |
| 102 sqlite3 db test.db |
| 103 sqlite3_backup B db2 main db main |
| 104 } -body { |
| 105 |
| 106 set rc [B step 50] |
| 107 if {$rc == "SQLITE_NOMEM" || $rc == "SQLITE_IOERR_NOMEM"} { |
| 108 error "out of memory" |
| 109 } |
| 110 |
| 111 } -test { |
| 112 faultsim_test_result {0 {}} |
| 113 faultsim_integrity_check |
| 114 |
| 115 # Finalize the backup. |
| 116 catch { B finish } |
| 117 } |
| 118 |
87 finish_test | 119 finish_test |
OLD | NEW |