1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Adjust requirements marks and add new requirements tests.

FossilOrigin-Name: ebb81dad1f43dac4636cd44d4055d1d4b198c675f73e23c5a2d8d992ae27fe1f
This commit is contained in:
drh
2019-06-12 22:46:04 +00:00
parent 13d0402077
commit 0ce974d122
6 changed files with 45 additions and 22 deletions

View File

@ -1644,16 +1644,40 @@ do_expr_test e_expr-31.2.4 {
} integer 9223372036854775807
# EVIDENCE-OF: R-09295-61337 Casting a TEXT or BLOB value into NUMERIC
# first does a forced conversion into REAL but then further converts the
# result into INTEGER if and only if the conversion from REAL to INTEGER
# is lossless and reversible.
# EVIDENCE-OF: R-55084-10555 Casting a TEXT or BLOB value into NUMERIC
# yields either an INTEGER or a REAL result.
#
# EVIDENCE-OF: R-48945-04866 If the input text looks like an integer
# (there is no decimal point nor exponent) and the value is small enough
# to fit in a 64-bit signed integer, then the result will be INTEGER.
#
# EVIDENCE-OF: R-47045-23194 Input text that looks like floating point
# (there is a decimal point and/or an exponent) and the text describes a
# value that can be losslessly converted back and forth between IEEE 754
# 64-bit float and a 51-bit signed integer, then the result is INTEGER.
#
do_expr_test e_expr-32.1.1 { CAST('45' AS NUMERIC) } integer 45
do_expr_test e_expr-32.1.2 { CAST('45.0' AS NUMERIC) } integer 45
do_expr_test e_expr-32.1.3 { CAST('45.2' AS NUMERIC) } real 45.2
do_expr_test e_expr-32.1.4 { CAST('11abc' AS NUMERIC) } integer 11
do_expr_test e_expr-32.1.5 { CAST('11.1abc' AS NUMERIC) } real 11.1
do_expr_test e_expr-32.1.6 {CAST( '9.223372036e14' AS NUMERIC)} integer 922337203600000
do_expr_test e_expr-32.1.7 {CAST('-9.223372036e14' AS NUMERIC)} integer -922337203600000
do_expr_test e_expr-32.1.8 {CAST( '9.223372036e15' AS NUMERIC)} real 9223372036000000.0
do_expr_test e_expr-32.1.9 {CAST('-9.223372036e15' AS NUMERIC)} real -9223372036000000.0
# EVIDENCE-OF: R-50300-26941 Any text input that describes a value
# outside the range of a 64-bit signed integer yields a REAL result.
#
do_expr_test e_expr-32.1.20 { CAST('9223372036854775807' AS numeric) } \
integer 9223372036854775807
do_expr_test e_expr-32.1.21 { CAST('9223372036854775808' AS numeric) } \
real 9.22337203685478e+18
do_expr_test e_expr-32.1.22 { CAST('-9223372036854775808' AS numeric) } \
integer -9223372036854775808
do_expr_test e_expr-32.1.23 { CAST('-9223372036854775809' AS numeric) } \
real -9.22337203685478e+18
# EVIDENCE-OF: R-30347-18702 Casting a REAL or INTEGER value to NUMERIC
# is a no-op, even if a real value could be losslessly converted to an