Fix incorrect CAST text->numeric if valid prefix is 1 char long

This commit is contained in:
Jussi Saurio
2025-02-18 15:07:36 +02:00
parent 899ba8367e
commit baf2aec3e9
2 changed files with 17 additions and 6 deletions

View File

@@ -739,6 +739,7 @@ do_execsql_test zeroblob-blob {
} {1}
# CAST tests - INTEGER affinity
do_execsql_test cast-text-to-integer {
SELECT CAST('123' AS INTEGER);
} {123}
@@ -747,6 +748,10 @@ do_execsql_test cast-text-with-spaces-to-integer {
SELECT CAST(' 123 ' AS INTEGER);
} {123}
do_execsql_test cast-text-with-trailing-junk-to-integer {
SELECT CAST('1abc' AS INTEGER);
} {1}
do_execsql_test cast-invalid-text-to-integer {
SELECT CAST('abc' AS INTEGER);
} {0}