OLD | NEW |
1 # 2006 November 08 | 1 # 2006 November 08 |
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. | 11 # This file implements regression tests for SQLite library. |
12 # | 12 # |
13 # This is a copy of the capi3.test file that has been adapted to | 13 # This is a copy of the capi3.test file that has been adapted to |
14 # test the new sqlite3_prepare_v2 interface. | 14 # test the new sqlite3_prepare_v2 interface. |
15 # | 15 # |
16 # $Id: capi3c.test,v 1.23 2009/07/22 07:27:57 danielk1977 Exp $ | 16 # $Id: capi3c.test,v 1.23 2009/07/22 07:27:57 danielk1977 Exp $ |
17 # | 17 # |
18 | 18 |
19 set testdir [file dirname $argv0] | 19 set testdir [file dirname $argv0] |
20 source $testdir/tester.tcl | 20 source $testdir/tester.tcl |
| 21 set testprefix capi3c |
21 | 22 |
22 # Do not use a codec for tests in this file, as the database file is | 23 # Do not use a codec for tests in this file, as the database file is |
23 # manipulated directly using tcl scripts (using the [hexio_write] command). | 24 # manipulated directly using tcl scripts (using the [hexio_write] command). |
24 # | 25 # |
25 do_not_use_codec | 26 do_not_use_codec |
26 | 27 |
27 # Return the UTF-16 representation of the supplied UTF-8 string $str. | 28 # Return the UTF-16 representation of the supplied UTF-8 string $str. |
28 # If $nt is true, append two 0x00 bytes as a nul terminator. | 29 # If $nt is true, append two 0x00 bytes as a nul terminator. |
29 proc utf16 {str {nt 1}} { | 30 proc utf16 {str {nt 1}} { |
30 set r [encoding convertto unicode $str] | 31 set r [encoding convertto unicode $str] |
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1368 do_test capi3c-24.5 { | 1369 do_test capi3c-24.5 { |
1369 decltype { | 1370 decltype { |
1370 SELECT (SELECT x FROM (SELECT c AS x)) | 1371 SELECT (SELECT x FROM (SELECT c AS x)) |
1371 FROM (SELECT * FROM t5 ORDER BY c LIMIT 1) ORDER BY b | 1372 FROM (SELECT * FROM t5 ORDER BY c LIMIT 1) ORDER BY b |
1372 } | 1373 } |
1373 } {DATETIME} | 1374 } {DATETIME} |
1374 do_test capi3c-24.3 { | 1375 do_test capi3c-24.3 { |
1375 decltype {SELECT (SELECT x FROM (SELECT t5.a AS x)) FROM t5} | 1376 decltype {SELECT (SELECT x FROM (SELECT t5.a AS x)) FROM t5} |
1376 } {INTEGER} | 1377 } {INTEGER} |
1377 | 1378 |
| 1379 |
| 1380 # Further tests of sqlite3_column_decltype(): |
| 1381 # |
| 1382 do_execsql_test 25.0 { |
| 1383 CREATE TABLE t11(a VARCHAR(10), b INTEGER); |
| 1384 CREATE TABLE t12(a VARCHAR(15), b FLOAT); |
| 1385 } |
| 1386 |
| 1387 foreach {tn sql} { |
| 1388 1 "SELECT * FROM t11 UNION ALL SELECT * FROM t12" |
| 1389 2 "SELECT * FROM t11 UNION SELECT * FROM t12" |
| 1390 3 "SELECT * FROM t11 EXCEPT SELECT * FROM t12" |
| 1391 4 "SELECT * FROM t11 INTERSECT SELECT * FROM t12" |
| 1392 |
| 1393 5 "SELECT * FROM t11 UNION ALL SELECT * FROM t12 ORDER BY 1" |
| 1394 6 "SELECT * FROM t11 UNION SELECT * FROM t12 ORDER BY 1" |
| 1395 7 "SELECT * FROM t11 EXCEPT SELECT * FROM t12 ORDER BY 1" |
| 1396 8 "SELECT * FROM t11 INTERSECT SELECT * FROM t12 ORDER BY 1" |
| 1397 } { |
| 1398 do_test 25.$tn { decltype $sql } {VARCHAR(10) INTEGER} |
| 1399 } |
| 1400 |
1378 finish_test | 1401 finish_test |
OLD | NEW |