]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Cause sqlite3_exper_new() to replicate UDFs and custom collations early enough to...
authorlarrybr <larrybr@noemail.net>
Mon, 25 Sep 2023 00:39:43 +0000 (00:39 +0000)
committerlarrybr <larrybr@noemail.net>
Mon, 25 Sep 2023 00:39:43 +0000 (00:39 +0000)
FossilOrigin-Name: 8fc2c45558a826a84e6f7e98564573da125a5e2d5c635a85bdeba2abe29fbfa1

ext/expert/sqlite3expert.c
manifest
manifest.uuid

index 87cc1ced32fcdda13a8e49b70db3eb750e442387..2d19f7a23a73bc70b1d583a14dc706420d060273 100644 (file)
@@ -1925,21 +1925,6 @@ sqlite3expert *sqlite3_expert_new(sqlite3 *db, char **pzErrmsg){
       sqlite3_db_config(pNew->dbm, SQLITE_DBCONFIG_TRIGGER_EQP, 1, (int*)0);
     }
   }
-  
-
-  /* Copy the entire schema of database [db] into [dbm]. */
-  if( rc==SQLITE_OK ){
-    sqlite3_stmt *pSql = 0;
-    rc = idxPrintfPrepareStmt(pNew->db, &pSql, pzErrmsg, 
-        "SELECT sql FROM sqlite_schema WHERE name NOT LIKE 'sqlite_%%'"
-        " AND sql NOT LIKE 'CREATE VIRTUAL %%'"
-    );
-    while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pSql) ){
-      const char *zSql = (const char*)sqlite3_column_text(pSql, 0);
-      if( zSql ) rc = sqlite3_exec(pNew->dbm, zSql, 0, 0, pzErrmsg);
-    }
-    idxFinalize(&rc, pSql);
-  }
 
   /* Allow custom collations to be dealt with through prepare. */
   if( rc==SQLITE_OK ) rc = sqlite3_collation_needed(pNew->dbm,0,useDummyCS);
@@ -1956,6 +1941,20 @@ sqlite3expert *sqlite3_expert_new(sqlite3 *db, char **pzErrmsg){
   }
 #endif
 
+  /* Copy the entire schema of database [db] into [dbm]. */
+  if( rc==SQLITE_OK ){
+    sqlite3_stmt *pSql = 0;
+    rc = idxPrintfPrepareStmt(pNew->db, &pSql, pzErrmsg, 
+        "SELECT sql FROM sqlite_schema WHERE name NOT LIKE 'sqlite_%%'"
+        " AND sql NOT LIKE 'CREATE VIRTUAL %%'"
+    );
+    while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pSql) ){
+      const char *zSql = (const char*)sqlite3_column_text(pSql, 0);
+      if( zSql ) rc = sqlite3_exec(pNew->dbm, zSql, 0, 0, pzErrmsg);
+    }
+    idxFinalize(&rc, pSql);
+  }
+
   /* Create the vtab schema */
   if( rc==SQLITE_OK ){
     rc = idxCreateVtabSchema(pNew, pzErrmsg);
index b7eb81ae5da0ef01e7c61df66d162568d9f82c52..6cf5f1135db2e1ce00220476c7638a18b6423579 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Make\sexpert\schanges\sacceptable\sto\sC89.
-D 2023-09-24T22:51:56.382
+C Cause\ssqlite3_exper_new()\sto\sreplicate\sUDFs\sand\scustom\scollations\searly\senough\sto\sappear\sin\svirtual\scolumn\sexpressions\sduring\sschema\scopy.\s[forum:/forumpost/e030aa4b3a|forum\spost\se030aa4b3a]
+D 2023-09-25T00:39:43.862
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -53,7 +53,7 @@ F ext/async/sqlite3async.h 46b47c79357b97ad85d20d2795942c0020dc20c532114a4980828
 F ext/expert/README.md b321c2762bb93c18ea102d5a5f7753a4b8bac646cb392b3b437f633caf2020c3
 F ext/expert/expert.c d548d603a4cc9e61f446cc179c120c6713511c413f82a4a32b1e1e69d3f086a4
 F ext/expert/expert1.test 77eaa3efd906e245a8948cb496174724b867b43b5c0fd9bb4fe7f77f27c64517
-F ext/expert/sqlite3expert.c 7b6b40b87aed69761b07231b563c96aa717e946224ffcfc035ce3e06e961516a
+F ext/expert/sqlite3expert.c 1803b13cbe118f01486479f557e5403459802a69d90886d7f0465f78f1f61719
 F ext/expert/sqlite3expert.h ca81efc2679a92373a13a3e76a6138d0310e32be53d6c3bfaedabd158ea8969b
 F ext/expert/test_expert.c d56c194b769bdc90cf829a14c9ecbc1edca9c850b837a4d0b13be14095c32a72
 F ext/fts3/README.content b9078d0843a094d86af0d48dffbff13c906702b4c3558012e67b9c7cc3bf59ee
@@ -2121,8 +2121,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 8ead1b5ed6693c0e3c30428033049c95a1fe636d1d1eff1734d0a896b5ff1f5a
-R b8f5b37eed5734a4c2ba7d4bb590bf8a
+P a4f03c22ec13d2f9769ac655ad77ccd906ab8c0ee32df37139bd998c234a7a0f
+R b4c830d70f3874dce787a7758a7f4657
 U larrybr
-Z cf1f60c591077eb093264126cb0986ef
+Z fb0500fa1bec856f4772f8e430b395b8
 # Remove this line to create a well-formed Fossil manifest.
index 0b209998c4942ebbb3954e3cbb6ecdc5d7f9213f..efe5d094077e58603f400b6b3e801b031ac863f2 100644 (file)
@@ -1 +1 @@
-a4f03c22ec13d2f9769ac655ad77ccd906ab8c0ee32df37139bd998c234a7a0f
\ No newline at end of file
+8fc2c45558a826a84e6f7e98564573da125a5e2d5c635a85bdeba2abe29fbfa1
\ No newline at end of file