]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
New JSON test cases showing insert or set with missing substructure.
authordrh <>
Thu, 30 Nov 2023 16:16:10 +0000 (16:16 +0000)
committerdrh <>
Thu, 30 Nov 2023 16:16:10 +0000 (16:16 +0000)
FossilOrigin-Name: 6802b6459d0d16c961ff41d240a6c88287f197d8f609090f79308707490a49c2

manifest
manifest.uuid
test/json101.test

index 766de1838f03c796b25160d04970d4d540799610..9f44093bfea062465c05ad8e290afa0d622950ae 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Update\ssome\sOPFS-related\shelp\stext\sin\sWASM\stests.\sMinor\scleanups\sin\sspeedtest1-worker.js.
-D 2023-11-30T10:00:25.069
+C New\sJSON\stest\scases\sshowing\sinsert\sor\sset\swith\smissing\ssubstructure.
+D 2023-11-30T16:16:10.846
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -1324,7 +1324,7 @@ F test/json/README.md 63e3e589e1df8fd3cc1588ba1faaff659214003f8b77a15af5c6452b35
 F test/json/json-generator.tcl dc0dd0f393800c98658fc4c47eaa6af29d4e17527380cd28656fb261bddc8a3f
 F test/json/json-q1.txt 65f9d1cdcc4cffa9823fb73ed936aae5658700cd001fde448f68bfb91c807307
 F test/json/json-speed-check.sh 8b7babf530faa58bd59d6d362cec8e9036a68c5457ff46f3b1f1511d21af6737 x
-F test/json101.test bc05d2476fd6f7ead31ec05b43d1b24b2b193ae112fd8f0d2ed56d9a904f9fa5
+F test/json101.test 4d8faf6a77152edadaf615bdfac4fb5556d131230cc2558f0912bed00a54943b
 F test/json102.test 4c69694773a470f1fda34e5f4ba24920b35184fb66050b450fc2ef9ab5ad310b
 F test/json103.test 53df87f83a4e5fa0c0a56eb29ff6c94055c6eb919f33316d62161a8880112dbe
 F test/json104.test 1b844a70cddcfa2e4cd81a5db0657b2e61e7f00868310f24f56a9ba0114348c1
@@ -2143,8 +2143,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 988c3179e978a3a6d42541e9c7a2ab98150383671810926503376ed808f150ff
-R 73ee9ef0435c8cda72f87d3ec03cb69f
-U stephan
-Z 88450718d2dd1d2993dee724cc33772c
+P 263f6d3a7784ef7d032dbf7a3265aca8dd70bf50797f28f6b2e8ddb6a301f83a
+R 0e9b3f433035365e3e741a55f5ab0daf
+U drh
+Z 72d2be7125d7371db00777b78c0fb9f8
 # Remove this line to create a well-formed Fossil manifest.
index af5689a92317f1ca8f62b6025d8e101dca5fcecf..fcbc7b3b7f22532a099417035fb68e36f3c4c158 100644 (file)
@@ -1 +1 @@
-263f6d3a7784ef7d032dbf7a3265aca8dd70bf50797f28f6b2e8ddb6a301f83a
\ No newline at end of file
+6802b6459d0d16c961ff41d240a6c88287f197d8f609090f79308707490a49c2
\ No newline at end of file
index c62991bbbf486793eda2c58a60feba4aa2d23cd6..5745e9d4cdfc7119a92c4ada2fa0d196d610fd77 100644 (file)
@@ -1054,6 +1054,30 @@ do_execsql_test json101-23.2 {
     FROM (SELECT json_set('[]','$[#]',0,'$[#]',1) AS j);
 } {{[0,1]} 0 1}
 
+# Insert/Set/Replace where the path specifies substructure that
+# does not yet exist
+#
+proc tx x {return [string map [list ( \173 ) \175 ' \042 < \133 > \135] $x]}
+foreach {id start path ins set repl} {
+  1 {{}}       {$.a.b.c}     ('a':('b':('c':9)))      ('a':('b':('c':9)))      ()
+  2 {{a:4}}    {$.a.b.c}     ('a':4)                  ('a':4)                  ('a':4)
+  3 {{a:{}}}   {$.a.b.c}     ('a':('b':('c':9)))      ('a':('b':('c':9)))      ('a':())
+  4 {[0,1,2]}  {$[3].a[0].b} <0,1,2,('a':<('b':9)>)>  <0,1,2,('a':<('b':9)>)>  <0,1,2>
+  5 {[0,1,2]}  {$[1].a[0].b} <0,1,2>                  <0,1,2>                  <0,1,2>
+  6 {[0,{},2]} {$[1].a[0].b} <0,('a':<('b':9)>),2>    <0,('a':<('b':9)>),2>    <0,(),2>
+  7 {[0,1,2]}  {$[3][0].b}   <0,1,2,<('b':9)>>        <0,1,2,<('b':9)>>        <0,1,2>
+  8 {[0,1,2]}  {$[1][0].b}   <0,1,2>                  <0,1,2>                  <0,1,2>
+} {
+  do_execsql_test json101-24.$id.insert {
+    SELECT json_insert($start,$path,9);
+  } [list [tx $ins]]
+  do_execsql_test json101-24.$id.set {
+    SELECT json_set($start,$path,9);
+  } [list [tx $set]]
+  do_execsql_test json101-24.$id.replace {
+    SELECT json_replace($start,$path,9);
+  } [list [tx $repl]]
+}
 
 
 finish_test