OLD | NEW |
1 # 2003 January 29 | 1 # 2003 January 29 |
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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 # Use the return value of sqlite3_column_count() to build | 445 # Use the return value of sqlite3_column_count() to build |
446 # a list of column indexes. i.e. If sqlite3_column_count | 446 # a list of column indexes. i.e. If sqlite3_column_count |
447 # is 3, build the list {0 1 2}. | 447 # is 3, build the list {0 1 2}. |
448 set ::idxlist [list] | 448 set ::idxlist [list] |
449 set numcols [sqlite3_data_count $STMT] | 449 set numcols [sqlite3_data_count $STMT] |
450 for {set i 0} {$i < $numcols} {incr i} {lappend ::idxlist $i} | 450 for {set i 0} {$i < $numcols} {incr i} {lappend ::idxlist $i} |
451 | 451 |
452 # types | 452 # types |
453 do_test $test.1 { | 453 do_test $test.1 { |
454 set types [list] | 454 set types [list] |
455 foreach i $idxlist {lappend types [sqlite3_column_type $STMT $i]} | 455 foreach i $idxlist { |
| 456 set x [sqlite3_column_type $STMT $i] |
| 457 # EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five |
| 458 # fundamental datatypes: 64-bit signed integer 64-bit IEEE floating |
| 459 # point number string BLOB NULL |
| 460 if {[lsearch {INTEGER FLOAT TEXT BLOB NULL} $x]<0} { |
| 461 set types ERROR |
| 462 break |
| 463 } else { |
| 464 lappend types $x |
| 465 } |
| 466 } |
456 set types | 467 set types |
457 } $types | 468 } $types |
| 469 |
458 | 470 |
459 # Integers | 471 # Integers |
460 do_test $test.2 { | 472 do_test $test.2 { |
461 set ints [list] | 473 set ints [list] |
462 foreach i $idxlist {lappend ints [sqlite3_column_int64 $STMT $i]} | 474 foreach i $idxlist {lappend ints [sqlite3_column_int64 $STMT $i]} |
463 set ints | 475 set ints |
464 } $ints | 476 } $ints |
465 | 477 |
466 # bytes | 478 # bytes |
467 set lens [list] | 479 set lens [list] |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1244 if {![info exists tester_do_binarylog]} { | 1256 if {![info exists tester_do_binarylog]} { |
1245 db close | 1257 db close |
1246 vfs_unregister_all | 1258 vfs_unregister_all |
1247 do_test capi3-20.1 { | 1259 do_test capi3-20.1 { |
1248 sqlite3_sleep 100 | 1260 sqlite3_sleep 100 |
1249 } {0} | 1261 } {0} |
1250 vfs_reregister_all | 1262 vfs_reregister_all |
1251 } | 1263 } |
1252 | 1264 |
1253 finish_test | 1265 finish_test |
OLD | NEW |