]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix the (non-deliverable, testing-use-only) closure extension so that it
authordrh <>
Fri, 26 Jun 2026 13:00:38 +0000 (13:00 +0000)
committerdrh <>
Fri, 26 Jun 2026 13:00:38 +0000 (13:00 +0000)
parses quoted instantiation arguments correctly.
[bugs:/info/2026-06-26T10:06:27Z|Bug 2026-06-26T10:06:27Z]

FossilOrigin-Name: 11ffa3bfba77b9f3a8c4903d496f63ee26c9873f735d254f35111eecf91228be

ext/misc/closure.c
manifest
manifest.uuid
test/closure01.test

index 22bfd888f5a595b8cfaab55d08dbb1705e92695b..6271a359d45fc173a3c6f0fc10755b5be4c90378 100644 (file)
 **
 *************************************************************************
 **
+** WARNING:  Experimental and obsolete.  Demonstration and testing only.
+**
+** This virtual table was created prior to the addition of support for
+** common table expressions in SQLite.  Common table expressions are a
+** better and more portable solution to any problem that this virtual
+** table solves.
+**
+** Given its experimental and testing-only status, the code here is
+** deactivated unless compiled with -DSQLITE_TEST=1
+**
+** DEMONSTRATION AND TESTING USE ONLY.
+**
 ** This file contains code for a virtual table that finds the transitive
 ** closure of a parent/child relationship in a real table.  The virtual 
 ** table is called "transitive_closure".
@@ -441,6 +453,7 @@ static char *closureDequote(const char *zIn){
         if( zIn[iIn]==q ) iIn++;
         zOut[iOut++] = zIn[iIn];
       }
+      zOut[iOut] = 0;
     }
     assert( (int)strlen(zOut)<=nIn );
   }
@@ -964,8 +977,8 @@ int sqlite3_closure_init(
   int rc = SQLITE_OK;
   SQLITE_EXTENSION_INIT2(pApi);
   (void)pzErrMsg;
-#ifndef SQLITE_OMIT_VIRTUALTABLE
+#if defined(SQLITE_TEST) && !defined(SQLITE_OMIT_VIRTUALTABLE)
   rc = sqlite3_create_module(db, "transitive_closure", &closureModule, 0);
-#endif /* SQLITE_OMIT_VIRTUALTABLE */
+#endif /* SQLITE_TEST && !SQLITE_OMIT_VIRTUALTABLE */
   return rc;
 }
index 47af038020e5cf0d721e2c78f43292f9826b082b..91d8446bcfebe14a68f813ac5d6275748b0ae173 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Mark\sthe\sdiskused()\sextension\sSQL\sfunction\sas\sdirect-only.\n[bugs:/info/2026-06-26T10:52:15Z|Bug\s2026-06-26T10:52:15Z]
-D 2026-06-26T12:34:22.616
+C Fix\sthe\s(non-deliverable,\stesting-use-only)\sclosure\sextension\sso\sthat\sit\nparses\squoted\sinstantiation\sarguments\scorrectly.\n[bugs:/info/2026-06-26T10:06:27Z|Bug\s2026-06-26T10:06:27Z]
+D 2026-06-26T13:00:38.462
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -368,7 +368,7 @@ F ext/misc/base85.c c713c7c81b05558c488cbdd8c68d612d5a97f9f0b8adf1167148dd7c89ce
 F ext/misc/basexx.c 89ad6b76558efbceb627afd5e2ef1d84b2e96d9aaf9b7ecb20e3d00b51be6fcf
 F ext/misc/btreeinfo.c 5fe97f798a9ee90e92b3031ed7969ec3f558661bb36b821c3ba045a17cfb951c
 F ext/misc/cksumvfs.c 9d7d0cf1a8893ac5d48922bfe9f3f217b4a61a6265f559263a02bb2001259913
-F ext/misc/closure.c c983987a8d7846c3e52b1885ed3e20af7d4ca52a81a8f94ec6d1cd68f93acc86
+F ext/misc/closure.c 6166746f1537a65e82ecc58e64e182f368006d1fe4c5b075a7558cb72ca3c57f
 F ext/misc/completion.c 3f5db28e88c3313103b2dd86d910a2944fd500c46754e473493968ce81e994a4
 F ext/misc/compress.c 5cc142aa82d1589a31c384657d0418c0eb0871348a2201e5dca32d24a0dd6654
 F ext/misc/csv.c 5ca451b9ce77322c4ce8476766e7ed18160e5c8b19e7cab76e13006d631b9e8f
@@ -970,7 +970,7 @@ F test/checkfault.test da6cb3d50247169efcb20bdf57863a3ccfa1d27d9e55cd324f0680096
 F test/chunksize.test faea11c5d6df9d392252a8dd879e1b1d68c9d3e8b7909cbed8bcec3b60c706f1
 F test/cksumvfs.test 38748166f486c59e8d94f3ee705040031ed3790a4dd69c4a9eef64f623a30ad4
 F test/close.test eccbad8ecd611d974cbf47278c3d4e5874faf02d811338d5d348af42d56d647c
-F test/closure01.test 9905883f1b171a4638f98fc764879f154e214a306d3d8daf412a15e7f3a9b1e0
+F test/closure01.test d3b90cc67744921a32a2421bb9f590fb6c8d2f14fbb1d7733ec0b2c37d45cab1
 F test/coalesce.test cee0dccb9fbd2d494b77234bccf9dc6c6786eb91
 F test/collate1.test 0890fa372753b59eba53832d37328af815f6b8e4b16761823180eeb62c8e8f64
 F test/collate2.test 471c6f74573382b89b0f8b88a05256faa52f7964f9e4799e76708a3b1ece6ba4
@@ -2208,8 +2208,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee
 F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
 F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c
-P df5728d79ff09235041cf01267104f29f482af3473f5a4c849133b6048565725
-R 00b34b44ad3507d6eceaeffb8c39078c
+P b66292820ad17b54eb5f0a48ef9ff01a1b52efd8004307c6faeeb4687ab50567
+R 059d769bb8ba784abd192f5efe4c2900
 U drh
-Z 7558894c56636701900220d926eb4097
+Z 0f7b48e8b55c0050caeaab0073fc641e
 # Remove this line to create a well-formed Fossil manifest.
index ef1d7ecc0a8d3e865249a44dcc2953595f19e00f..dfeac5621adfafb14eb94269d3e5311d12476606 100644 (file)
@@ -1 +1 @@
-b66292820ad17b54eb5f0a48ef9ff01a1b52efd8004307c6faeeb4687ab50567
+11ffa3bfba77b9f3a8c4903d496f63ee26c9873f735d254f35111eecf91228be
index ee3f2dd1d02b3a33642456c143897030847ae05c..a2f9cf88a978d233efc2ba9d1c5a2c18c91b89bc 100644 (file)
@@ -292,4 +292,20 @@ do_execsql_test 6.1 {
   SELECT * FROM t4, vt4 WHERE t4.id = vt4.root AND vt4.id=4 AND vt4.depth=2;
 }
 
+# Bug 2026-06-26T10:06:27Z
+#
+reset_db
+load_static_extension db closure
+do_execsql_test 7.1 {
+  CREATE TABLE t(p, abcx);
+  INSERT INTO t VALUES(1, 2);
+}
+do_execsql_test 7.2 {
+  CREATE VIRTUAL TABLE c
+    USING transitive_closure(idcolumn='abc'x, tablename='t', parentcolumn='p');
+}
+do_execsql_test 7.3 {
+  SELECT * FROM c WHERE root=1;
+} {1 0 2 1}
+
 finish_test