aboutsummaryrefslogtreecommitdiff
path: root/test/func.test
diff options
context:
space:
mode:
authordrh <>2023-06-22 15:26:52 +0000
committerdrh <>2023-06-22 15:26:52 +0000
commit7f9dcd664da8b6694be228f3084c88f2115fc2a0 (patch)
treebdc92689dcbb2581b182c45cfc9d7bd7340dc777 /test/func.test
parentd6c671e626640af933c0a1e73555eaa935ab3a31 (diff)
downloadsqlite-7f9dcd664da8b6694be228f3084c88f2115fc2a0.tar.gz
sqlite-7f9dcd664da8b6694be228f3084c88f2115fc2a0.zip
basic test cases for octet_length().
FossilOrigin-Name: 034a5fe2a0cfe085271385da1d281515b04b311e08962519d03ad8ad156fb4bd
Diffstat (limited to 'test/func.test')
-rw-r--r--test/func.test23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/func.test b/test/func.test
index df9d4dacf..6ba953647 100644
--- a/test/func.test
+++ b/test/func.test
@@ -42,6 +42,9 @@ do_test func-0.1 {
do_test func-1.0 {
execsql {SELECT length(t1) FROM tbl1 ORDER BY t1}
} {4 2 7 8 4}
+do_execsql_test func-1.0b {
+ SELECT octet_length(t1) FROM tbl1 ORDER BY t1;
+} {4 2 7 8 4}
do_test func-1.1 {
set r [catch {execsql {SELECT length(*) FROM tbl1 ORDER BY t1}} msg]
lappend r $msg
@@ -57,9 +60,29 @@ do_test func-1.3 {
do_test func-1.4 {
execsql {SELECT coalesce(length(a),-1) FROM t2}
} {1 -1 3 -1 5}
+do_execsql_test func-1.5 {
+ SELECT octet_length(12345);
+} {5}
+db null NULL
+do_execsql_test func-1.6 {
+ SELECT octet_length(NULL);
+} {NULL}
+do_execsql_test func-1.7 {
+ SELECT octet_length(7.5);
+} {3}
+do_execsql_test func-1.8 {
+ SELECT octet_length(x'30313233');
+} {4}
+do_execsql_test func-1.9 {
+ WITH c(x) AS (VALUES(char(350,351,352,353,354)))
+ SELECT length(x), octet_length(x) FROM c;
+} {5 10}
+
+
# Check out the substr() function
#
+db null {}
do_test func-2.0 {
execsql {SELECT substr(t1,1,2) FROM tbl1 ORDER BY t1}
} {fr is pr so th}