| OLD | NEW |
| 1 # 2002 November 30 | 1 # 2002 November 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 #*********************************************************************** |
| 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. | 13 # files larger than 4GB. |
| 14 # | 14 # |
| 15 # $Id: bigfile.test,v 1.12 2009/03/05 04:27:08 shane Exp $ | 15 # $Id: bigfile.test,v 1.12 2009/03/05 04:27:08 shane Exp $ |
| 16 # | 16 # |
| 17 | 17 |
| 18 if {[file exists skip-big-file]} return |
| 19 if {$tcl_platform(os)=="Darwin"} return |
| 20 |
| 18 set testdir [file dirname $argv0] | 21 set testdir [file dirname $argv0] |
| 19 source $testdir/tester.tcl | 22 source $testdir/tester.tcl |
| 20 | 23 |
| 21 # Do not use a codec for this file, as the database is manipulated using | 24 # Do not use a codec for this file, as the database is manipulated using |
| 22 # external methods (the [fake_big_file] and [hexio_write] commands). | 25 # external methods (the [fake_big_file] and [hexio_write] commands). |
| 23 # | 26 # |
| 24 do_not_use_codec | 27 do_not_use_codec |
| 25 | 28 |
| 26 # If SQLITE_DISABLE_LFS is defined, omit this file. | 29 # If SQLITE_DISABLE_LFS is defined, omit this file. |
| 27 ifcapable !lfs { | 30 ifcapable !lfs { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 execsql { | 65 execsql { |
| 63 SELECT md5sum(x) FROM t1; | 66 SELECT md5sum(x) FROM t1; |
| 64 } | 67 } |
| 65 } $::MAGIC_SUM | 68 } $::MAGIC_SUM |
| 66 | 69 |
| 67 # Try to create a large file - a file that is larger than 2^32 bytes. | 70 # Try to create a large file - a file that is larger than 2^32 bytes. |
| 68 # If this fails, it means that the system being tested does not support | 71 # If this fails, it means that the system being tested does not support |
| 69 # large files. So skip all of the remaining tests in this file. | 72 # large files. So skip all of the remaining tests in this file. |
| 70 # | 73 # |
| 71 db close | 74 db close |
| 72 if {[catch {fake_big_file 4096 [pwd]/test.db} msg]} { | 75 if {[catch {fake_big_file 4096 [get_pwd]/test.db} msg]} { |
| 73 puts "**** Unable to create a file larger than 4096 MB. *****" | 76 puts "**** Unable to create a file larger than 4096 MB. *****" |
| 74 finish_test | 77 finish_test |
| 75 return | 78 return |
| 76 } | 79 } |
| 77 hexio_write test.db 28 00000000 | 80 hexio_write test.db 28 00000000 |
| 78 | 81 |
| 79 do_test bigfile-1.2 { | 82 do_test bigfile-1.2 { |
| 80 sqlite3 db test.db | 83 sqlite3 db test.db |
| 81 execsql { | 84 execsql { |
| 82 SELECT md5sum(x) FROM t1; | 85 SELECT md5sum(x) FROM t1; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 102 } $::MAGIC_SUM | 105 } $::MAGIC_SUM |
| 103 do_test bigfile-1.4 { | 106 do_test bigfile-1.4 { |
| 104 db close | 107 db close |
| 105 sqlite3 db test.db | 108 sqlite3 db test.db |
| 106 execsql { | 109 execsql { |
| 107 SELECT md5sum(x) FROM t1; | 110 SELECT md5sum(x) FROM t1; |
| 108 } | 111 } |
| 109 } $::MAGIC_SUM | 112 } $::MAGIC_SUM |
| 110 | 113 |
| 111 db close | 114 db close |
| 112 if {[catch {fake_big_file 8192 [pwd]/test.db}]} { | 115 if {[catch {fake_big_file 8192 [get_pwd]/test.db}]} { |
| 113 puts "**** Unable to create a file larger than 8192 MB. *****" | 116 puts "**** Unable to create a file larger than 8192 MB. *****" |
| 114 finish_test | 117 finish_test |
| 115 return | 118 return |
| 116 } | 119 } |
| 117 hexio_write test.db 28 00000000 | 120 hexio_write test.db 28 00000000 |
| 118 | 121 |
| 119 do_test bigfile-1.5 { | 122 do_test bigfile-1.5 { |
| 120 sqlite3 db test.db | 123 sqlite3 db test.db |
| 121 execsql { | 124 execsql { |
| 122 SELECT md5sum(x) FROM t1; | 125 SELECT md5sum(x) FROM t1; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 141 SELECT md5sum(x) FROM t1; | 144 SELECT md5sum(x) FROM t1; |
| 142 } | 145 } |
| 143 } $::MAGIC_SUM | 146 } $::MAGIC_SUM |
| 144 do_test bigfile-1.9 { | 147 do_test bigfile-1.9 { |
| 145 execsql { | 148 execsql { |
| 146 SELECT md5sum(x) FROM t2; | 149 SELECT md5sum(x) FROM t2; |
| 147 } | 150 } |
| 148 } $::MAGIC_SUM | 151 } $::MAGIC_SUM |
| 149 | 152 |
| 150 db close | 153 db close |
| 151 if {[catch {fake_big_file 16384 [pwd]/test.db}]} { | 154 if {[catch {fake_big_file 16384 [get_pwd]/test.db}]} { |
| 152 puts "**** Unable to create a file larger than 16384 MB. *****" | 155 puts "**** Unable to create a file larger than 16384 MB. *****" |
| 153 finish_test | 156 finish_test |
| 154 return | 157 return |
| 155 } | 158 } |
| 156 hexio_write test.db 28 00000000 | 159 hexio_write test.db 28 00000000 |
| 157 | 160 |
| 158 do_test bigfile-1.10 { | 161 do_test bigfile-1.10 { |
| 159 sqlite3 db test.db | 162 sqlite3 db test.db |
| 160 execsql { | 163 execsql { |
| 161 SELECT md5sum(x) FROM t1; | 164 SELECT md5sum(x) FROM t1; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 191 SELECT md5sum(x) FROM t2; | 194 SELECT md5sum(x) FROM t2; |
| 192 } | 195 } |
| 193 } $::MAGIC_SUM | 196 } $::MAGIC_SUM |
| 194 do_test bigfile-1.16 { | 197 do_test bigfile-1.16 { |
| 195 execsql { | 198 execsql { |
| 196 SELECT md5sum(x) FROM t3; | 199 SELECT md5sum(x) FROM t3; |
| 197 } | 200 } |
| 198 } $::MAGIC_SUM | 201 } $::MAGIC_SUM |
| 199 | 202 |
| 200 finish_test | 203 finish_test |
| OLD | NEW |