OLD | NEW |
1 # 2010 July 16 | 1 # 2010 July 16 |
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 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1419 INSERT INTO t3 VALUES(X'555655', '1.23abc', 4.5); | 1419 INSERT INTO t3 VALUES(X'555655', '1.23abc', 4.5); |
1420 SELECT typeof(a), a, typeof(b), b, typeof(c), c FROM t3; | 1420 SELECT typeof(a), a, typeof(b), b, typeof(c), c FROM t3; |
1421 } {blob UVU text 1.23abc real 4.5} | 1421 } {blob UVU text 1.23abc real 4.5} |
1422 do_execsql_test e_expr-27.1.2 { | 1422 do_execsql_test e_expr-27.1.2 { |
1423 SELECT | 1423 SELECT |
1424 typeof(CAST(X'555655' as TEXT)), CAST(X'555655' as TEXT), | 1424 typeof(CAST(X'555655' as TEXT)), CAST(X'555655' as TEXT), |
1425 typeof(CAST('1.23abc' as REAL)), CAST('1.23abc' as REAL), | 1425 typeof(CAST('1.23abc' as REAL)), CAST('1.23abc' as REAL), |
1426 typeof(CAST(4.5 as INTEGER)), CAST(4.5 as INTEGER) | 1426 typeof(CAST(4.5 as INTEGER)), CAST(4.5 as INTEGER) |
1427 } {text UVU real 1.23 integer 4} | 1427 } {text UVU real 1.23 integer 4} |
1428 | 1428 |
1429 # EVIDENCE-OF: R-27225-65050 If the value of <expr> is NULL, then | 1429 # EVIDENCE-OF: R-32434-09092 If the value of expr is NULL, then the |
1430 # the result of the CAST expression is also NULL. | 1430 # result of the CAST expression is also NULL. |
1431 # | 1431 # |
1432 do_expr_test e_expr-27.2.1 { CAST(NULL AS integer) } null {} | 1432 do_expr_test e_expr-27.2.1 { CAST(NULL AS integer) } null {} |
1433 do_expr_test e_expr-27.2.2 { CAST(NULL AS text) } null {} | 1433 do_expr_test e_expr-27.2.2 { CAST(NULL AS text) } null {} |
1434 do_expr_test e_expr-27.2.3 { CAST(NULL AS blob) } null {} | 1434 do_expr_test e_expr-27.2.3 { CAST(NULL AS blob) } null {} |
1435 do_expr_test e_expr-27.2.4 { CAST(NULL AS number) } null {} | 1435 do_expr_test e_expr-27.2.4 { CAST(NULL AS number) } null {} |
1436 | 1436 |
1437 # EVIDENCE-OF: R-31076-23575 Casting a value to a <type-name> with | 1437 # EVIDENCE-OF: R-43522-35548 Casting a value to a type-name with no |
1438 # no affinity causes the value to be converted into a BLOB. | 1438 # affinity causes the value to be converted into a BLOB. |
1439 # | 1439 # |
1440 do_expr_test e_expr-27.3.1 { CAST('abc' AS blob) } blob abc | 1440 do_expr_test e_expr-27.3.1 { CAST('abc' AS blob) } blob abc |
1441 do_expr_test e_expr-27.3.2 { CAST('def' AS shobblob_x) } blob def | 1441 do_expr_test e_expr-27.3.2 { CAST('def' AS shobblob_x) } blob def |
1442 do_expr_test e_expr-27.3.3 { CAST('ghi' AS abbLOb10) } blob ghi | 1442 do_expr_test e_expr-27.3.3 { CAST('ghi' AS abbLOb10) } blob ghi |
1443 | 1443 |
1444 # EVIDENCE-OF: R-22956-37754 Casting to a BLOB consists of first casting | 1444 # EVIDENCE-OF: R-22956-37754 Casting to a BLOB consists of first casting |
1445 # the value to TEXT in the encoding of the database connection, then | 1445 # the value to TEXT in the encoding of the database connection, then |
1446 # interpreting the resulting byte sequence as a BLOB instead of as TEXT. | 1446 # interpreting the resulting byte sequence as a BLOB instead of as TEXT. |
1447 # | 1447 # |
1448 do_qexpr_test e_expr-27.4.1 { CAST('ghi' AS blob) } X'676869' | 1448 do_qexpr_test e_expr-27.4.1 { CAST('ghi' AS blob) } X'676869' |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1892 } {true} | 1892 } {true} |
1893 do_execsql_test e_expr-37.9 { | 1893 do_execsql_test e_expr-37.9 { |
1894 SELECT CASE WHEN -0.1 THEN 'true' ELSE 'false' END; | 1894 SELECT CASE WHEN -0.1 THEN 'true' ELSE 'false' END; |
1895 } {true} | 1895 } {true} |
1896 do_execsql_test e_expr-37.10 { | 1896 do_execsql_test e_expr-37.10 { |
1897 SELECT CASE WHEN '1english' THEN 'true' ELSE 'false' END; | 1897 SELECT CASE WHEN '1english' THEN 'true' ELSE 'false' END; |
1898 } {true} | 1898 } {true} |
1899 | 1899 |
1900 | 1900 |
1901 finish_test | 1901 finish_test |
OLD | NEW |