| OLD | NEW |
| 1 # 2009 February 24 | 1 # 2009 February 24 |
| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 # Get the list of defines using the pragma, | 189 # Get the list of defines using the pragma, |
| 190 # then try querying each one with the functions. | 190 # then try querying each one with the functions. |
| 191 set ans [ catchsql { | 191 set ans [ catchsql { |
| 192 PRAGMA compile_options; | 192 PRAGMA compile_options; |
| 193 } ] | 193 } ] |
| 194 set opts [ lindex $ans 1 ] | 194 set opts [ lindex $ans 1 ] |
| 195 set tc 1 | 195 set tc 1 |
| 196 foreach opt $opts { | 196 foreach opt $opts { |
| 197 do_test ctime-2.5.$tc { | 197 do_test ctime-2.5.$tc { |
| 198 set N [ expr {$tc-1} ] | 198 set N [ expr {$tc-1} ] |
| 199 set ans1 [ catchsql { | 199 set ans1 [catch {db one { |
| 200 SELECT sqlite_compileoption_get($N); | 200 SELECT sqlite_compileoption_get($N); |
| 201 } ] | 201 }} msg] |
| 202 lappend ans1 $msg |
| 202 set ans2 [ catchsql { | 203 set ans2 [ catchsql { |
| 203 SELECT sqlite_compileoption_used($opt); | 204 SELECT sqlite_compileoption_used($opt); |
| 204 } ] | 205 } ] |
| 205 list [ lindex $ans1 0 ] [ expr { [lindex $ans1 1]==$opt } ] \ | 206 list [ lindex $ans1 0 ] [ expr { [lindex $ans1 1]==$opt } ] \ |
| 206 [ expr { $ans2 } ] | 207 [ expr { $ans2 } ] |
| 207 } {0 1 {0 1}} | 208 } {0 1 {0 1}} |
| 208 incr tc 1 | 209 incr tc 1 |
| 209 } | 210 } |
| 210 # test 1 past array bounds | 211 # test 1 past array bounds |
| 211 do_test ctime-2.5.$tc { | 212 do_test ctime-2.5.$tc { |
| 212 set N [ expr {$tc-1} ] | 213 set N [ expr {$tc-1} ] |
| 213 set ans [ catchsql { | 214 set ans [ catchsql { |
| 214 SELECT sqlite_compileoption_get($N); | 215 SELECT sqlite_compileoption_get($N); |
| 215 } ] | 216 } ] |
| 216 } {0 {{}}} | 217 } {0 {{}}} |
| 217 incr tc 1 | 218 incr tc 1 |
| 218 # test 1 before array bounds (N=-1) | 219 # test 1 before array bounds (N=-1) |
| 219 do_test ctime-2.5.$tc { | 220 do_test ctime-2.5.$tc { |
| 220 set N -1 | 221 set N -1 |
| 221 set ans [ catchsql { | 222 set ans [ catchsql { |
| 222 SELECT sqlite_compileoption_get($N); | 223 SELECT sqlite_compileoption_get($N); |
| 223 } ] | 224 } ] |
| 224 } {0 {{}}} | 225 } {0 {{}}} |
| 225 | 226 |
| 227 #-------------------------------------------------------------------------- |
| 228 # Test that SQLITE_DIRECT_OVERFLOW_READ is reflected in the output of |
| 229 # "PRAGMA compile_options". |
| 230 # |
| 231 ifcapable direct_read { |
| 232 set res 1 |
| 233 } else { |
| 234 set res 0 |
| 235 } |
| 236 do_test ctime-3.0.1 { |
| 237 expr [lsearch [db eval {PRAGMA compile_options}] DIRECT_OVERFLOW_READ]>=0 |
| 238 } $res |
| 226 | 239 |
| 227 finish_test | 240 finish_test |
| OLD | NEW |