summaryrefslogtreecommitdiffstats
path: root/test/json102.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 05:16:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 05:16:43 +0000
commitfd8f22aa0eaf2a7726a6db288946cd904388ac4e (patch)
tree483f8cace8e3e64c9df42cef34c474bd225209ab /test/json102.test
parentAdding upstream version 3.45.3. (diff)
downloadsqlite3-fd8f22aa0eaf2a7726a6db288946cd904388ac4e.tar.xz
sqlite3-fd8f22aa0eaf2a7726a6db288946cd904388ac4e.zip
Adding upstream version 3.46.0.upstream/3.46.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/json102.test')
-rw-r--r--test/json102.test31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/json102.test b/test/json102.test
index 15a54b4..1a00cb6 100644
--- a/test/json102.test
+++ b/test/json102.test
@@ -764,4 +764,35 @@ do_execsql_test json102-1720 {
SELECT * FROM t1;
} {ok 2023-08-03 876 5 {{"x":77,"y":6}}}
+# 2024-05-21 https://sqlite.org/forum/forumpost/9e52cdfe15c3926e
+# What if the RHS of the -> or ->> operator is a string that looks
+# like a number? PostgreSQL treats it as a string.
+#
+do_execsql_test json102-1800 {
+ SELECT '{"1":"one","2":"two","3":"three"}'->>'2';
+} two
+db null NULL
+do_execsql_test json102-1801 {
+ SELECT '{"1":"one","2":"two","3":"three"}'->>2;
+} NULL
+do_execsql_test json102-1810 {
+ SELECT '["zero","one","two"]'->>'1';
+} NULL
+do_execsql_test json102-1811 {
+ SELECT '["zero","one","two"]'->>1;
+} one
+do_execsql_test json102-1820 {
+ SELECT '{"1":"one","2":"two","3":"three"}'->'2';
+} {{"two"}}
+do_execsql_test json102-1821 {
+ SELECT '{"1":"one","2":"two","3":"three"}'->2;
+} {NULL}
+do_execsql_test json102-1830 {
+ SELECT '["zero","one","two"]'->'1';
+} {NULL}
+do_execsql_test json102-1831 {
+ SELECT '["zero","one","two"]'->1;
+} {{"one"}}
+
+
finish_test