| OLD | NEW |
| 1 # 2012 October 13 | 1 # 2012 October 13 |
| 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 #*********************************************************************** |
| 11 # | 11 # |
| 12 # The tests in this file verify that if an empty database (zero bytes in | 12 # The tests in this file verify that if an empty database (zero bytes in |
| 13 # size) is used as the source of a backup operation, the final destination | 13 # size) is used as the source of a backup operation, the final destination |
| 14 # database is one page in size. | 14 # database is one page in size. |
| 15 # | 15 # |
| 16 # The destination must consist of at least one page as truncating a | 16 # The destination must consist of at least one page as truncating a |
| 17 # database file to zero bytes is equivalent to resetting the database | 17 # database file to zero bytes is equivalent to resetting the database |
| 18 # schema cookie and change counter. Doing that could cause other clients | 18 # schema cookie and change counter. Doing that could cause other clients |
| 19 # to become confused and continue using out-of-date cache data. | 19 # to become confused and continue using out-of-date cache data. |
| 20 # | 20 # |
| 21 | 21 |
| 22 set testdir [file dirname $argv0] | 22 set testdir [file dirname $argv0] |
| 23 source $testdir/tester.tcl | 23 source $testdir/tester.tcl |
| 24 set testprefix backup4 | 24 set testprefix backup4 |
| 25 | 25 |
| 26 # The codec logic does not work for zero-length database files. A database |
| 27 # file must contain at least one page in order to be recognized as an |
| 28 # encrypted database. |
| 29 do_not_use_codec |
| 30 |
| 26 #------------------------------------------------------------------------- | 31 #------------------------------------------------------------------------- |
| 27 # At one point this test was failing because [db] was using an out of | 32 # At one point this test was failing because [db] was using an out of |
| 28 # date schema in test case 1.2. | 33 # date schema in test case 1.2. |
| 29 # | 34 # |
| 30 do_execsql_test 1.0 { | 35 do_execsql_test 1.0 { |
| 31 CREATE TABLE t1(x, y, UNIQUE(x, y)); | 36 CREATE TABLE t1(x, y, UNIQUE(x, y)); |
| 32 INSERT INTO t1 VALUES('one', 'two'); | 37 INSERT INTO t1 VALUES('one', 'two'); |
| 33 SELECT * FROM t1 WHERE x='one'; | 38 SELECT * FROM t1 WHERE x='one'; |
| 34 PRAGMA integrity_check; | 39 PRAGMA integrity_check; |
| 35 } {one two ok} | 40 } {one two ok} |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 do_test 3.3 { | 99 do_test 3.3 { |
| 95 sqlite3 db1 test.db2 | 100 sqlite3 db1 test.db2 |
| 96 db1 backup test.db | 101 db1 backup test.db |
| 97 db1 close | 102 db1 close |
| 98 file size test.db | 103 file size test.db |
| 99 } {1024} | 104 } {1024} |
| 100 | 105 |
| 101 do_test 3.4 { file size test.db2 } 0 | 106 do_test 3.4 { file size test.db2 } 0 |
| 102 | 107 |
| 103 finish_test | 108 finish_test |
| OLD | NEW |