| OLD | NEW |
| 1 # 2010 July 07 | 1 # 2010 July 07 |
| 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 # This file implements regression tests for SQLite library. The | 11 # This file implements regression tests for SQLite library. The |
| 12 # focus of this script testing the ability of SQLite to handle database | 12 # focus of this script testing the ability of SQLite to handle database |
| 13 # files larger than 4GB in WAL mode. | 13 # files larger than 4GB in WAL mode. |
| 14 # | 14 # |
| 15 | 15 |
| 16 | 16 |
| 17 set testdir [file dirname $argv0] | 17 set testdir [file dirname $argv0] |
| 18 source $testdir/tester.tcl | 18 source $testdir/tester.tcl |
| 19 | 19 |
| 20 ifcapable !wal { |
| 21 finish_test |
| 22 return |
| 23 } |
| 24 |
| 20 # Do not use a codec for this file, as the database is manipulated using | 25 # Do not use a codec for this file, as the database is manipulated using |
| 21 # external methods (the [fake_big_file] and [hexio_write] commands). | 26 # external methods (the [fake_big_file] and [hexio_write] commands). |
| 22 # | 27 # |
| 23 do_not_use_codec | 28 do_not_use_codec |
| 24 | 29 |
| 25 # If SQLITE_DISABLE_LFS is defined, omit this file. | 30 # If SQLITE_DISABLE_LFS is defined, omit this file. |
| 26 ifcapable !lfs { | 31 ifcapable !lfs { |
| 27 finish_test | 32 finish_test |
| 28 return | 33 return |
| 29 } | 34 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 40 PRAGMA journal_mode = WAL; | 45 PRAGMA journal_mode = WAL; |
| 41 CREATE TABLE t1(a PRIMARY KEY, b UNIQUE); | 46 CREATE TABLE t1(a PRIMARY KEY, b UNIQUE); |
| 42 INSERT INTO t1 VALUES(a_string(300), a_string(500)); | 47 INSERT INTO t1 VALUES(a_string(300), a_string(500)); |
| 43 INSERT INTO t1 SELECT a_string(300), a_string(500) FROM t1; | 48 INSERT INTO t1 SELECT a_string(300), a_string(500) FROM t1; |
| 44 INSERT INTO t1 SELECT a_string(300), a_string(500) FROM t1; | 49 INSERT INTO t1 SELECT a_string(300), a_string(500) FROM t1; |
| 45 INSERT INTO t1 SELECT a_string(300), a_string(500) FROM t1; | 50 INSERT INTO t1 SELECT a_string(300), a_string(500) FROM t1; |
| 46 } | 51 } |
| 47 } {wal} | 52 } {wal} |
| 48 | 53 |
| 49 db close | 54 db close |
| 50 if {[catch {fake_big_file 5000 [pwd]/test.db}]} { | 55 if {[catch {fake_big_file 5000 [get_pwd]/test.db}]} { |
| 51 puts "**** Unable to create a file larger than 5000 MB. *****" | 56 puts "**** Unable to create a file larger than 5000 MB. *****" |
| 52 finish_test | 57 finish_test |
| 53 return | 58 return |
| 54 } | 59 } |
| 55 hexio_write test.db 28 00000000 | 60 hexio_write test.db 28 00000000 |
| 56 | 61 |
| 57 sqlite3 db test.db | 62 sqlite3 db test.db |
| 58 db func a_string a_string | 63 db func a_string a_string |
| 59 do_test walbig-1.1 { | 64 do_test walbig-1.1 { |
| 60 execsql { INSERT INTO t1 SELECT a_string(300), a_string(500) FROM t1 } | 65 execsql { INSERT INTO t1 SELECT a_string(300), a_string(500) FROM t1 } |
| 61 } {} | 66 } {} |
| 62 db close | 67 db close |
| 63 | 68 |
| 64 sqlite3 db test.db | 69 sqlite3 db test.db |
| 65 do_test walbig-1.2 { | 70 do_test walbig-1.2 { |
| 66 execsql { SELECT a FROM t1 ORDER BY a } | 71 execsql { SELECT a FROM t1 ORDER BY a } |
| 67 } [lsort [execsql { SELECT a FROM t1 ORDER BY rowid }]] | 72 } [lsort [execsql { SELECT a FROM t1 ORDER BY rowid }]] |
| 68 | 73 |
| 69 do_test walbig-1.3 { | 74 do_test walbig-1.3 { |
| 70 execsql { SELECT b FROM t1 ORDER BY b } | 75 execsql { SELECT b FROM t1 ORDER BY b } |
| 71 } [lsort [execsql { SELECT b FROM t1 ORDER BY rowid }]] | 76 } [lsort [execsql { SELECT b FROM t1 ORDER BY rowid }]] |
| 72 | 77 |
| 73 finish_test | 78 finish_test |
| OLD | NEW |