]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Do not leave a WITHOUT ROWID table without a primary key index structure
authordrh <>
Tue, 13 Apr 2021 13:48:31 +0000 (13:48 +0000)
committerdrh <>
Tue, 13 Apr 2021 13:48:31 +0000 (13:48 +0000)
due to an OOM error.  This prevents downstream troubles in the case of
PRAGMA writable_schema=ON.
dbsqlfuzz 69fb32cc82d59b4d790881566e3f6c727e616122

FossilOrigin-Name: 608b6644b932c4d0c26ab870322639deefde4606f9e335575f99995bc7ed08b5

manifest
manifest.uuid
src/build.c

index 665da2457fa8cb635c5c67f9cd256efa8be409c7..37667467dc569ba1d66b38997b587fa2f53c77b0 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C The\sSQLITE_NoSchemaError\sflag\sshould\snot\sapply\sto\sOOM\serrors\swhile\sparsing\sthe\nschema.
-D 2021-04-13T13:20:55.915
+C Do\snot\sleave\sa\sWITHOUT\sROWID\stable\swithout\sa\sprimary\skey\sindex\sstructure\ndue\sto\san\sOOM\serror.\s\sThis\sprevents\sdownstream\stroubles\sin\sthe\scase\sof\nPRAGMA\swritable_schema=ON.\ndbsqlfuzz\s69fb32cc82d59b4d790881566e3f6c727e616122
+D 2021-04-13T13:48:31.960
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -486,7 +486,7 @@ F src/btmutex.c 8acc2f464ee76324bf13310df5692a262b801808984c1b79defb2503bbafadb6
 F src/btree.c 15cfe91aa3b3b91d3dc20faaa7c64b627ca9794b22be8b184054cb6b947505fc
 F src/btree.h 096cc53baa58be22b02c896d1cf933c38cfc6d65f9253c1367ece8cc88a24de5
 F src/btreeInt.h 7bc15a24a02662409ebcd6aeaa1065522d14b7fda71573a2b0568b458f514ae0
-F src/build.c 3a63a0dd142e238247fba0c20d6321ef1a8917de7814657ad279a02d2ff6da78
+F src/build.c 9f15ff3e074d3989cc1396f575118eb4c28fb677d33f54393ec263799c94b5bd
 F src/callback.c d0b853dd413255d2e337b34545e54d888ea02f20da5ad0e63585b389624c4a6c
 F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
 F src/ctime.c 2a322b9a3d75771fb4d99e0702851f4f68dda982507a0f798eefb0712969a410
@@ -1912,7 +1912,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P fb305fe077a0058861427f107957fcc3d2b1443cdd11a7f145df138ca3bb9f4e
-R 16d2df35bbd6b7e36a26a7b3428902ad
+P 9cc484ad1a42f0821e53be6df46b1811dc8059e5aaf2f6c3e667105a55893b97
+R 251fed4b3f9e0fd7365e7ace01b2ae49
 U drh
-Z 656f71d21e31ebbc749d2994697a3864
+Z c08c9ca90948154693571a1bdfd1ec20
index 817a69a2f5c238fc5dcd539e3a2be03b00b43819..4f1151dc0ade076c295f174534398f3b14962b93 100644 (file)
@@ -1 +1 @@
-9cc484ad1a42f0821e53be6df46b1811dc8059e5aaf2f6c3e667105a55893b97
\ No newline at end of file
+608b6644b932c4d0c26ab870322639deefde4606f9e335575f99995bc7ed08b5
\ No newline at end of file
index 350b14da4c7c41dd700d0551095d54b158705aec..a6a6edb9b8fbc556f50edbadd4bb6e39a3efac04 100644 (file)
@@ -2188,7 +2188,10 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){
     pTab->iPKey = -1;
     sqlite3CreateIndex(pParse, 0, 0, 0, pList, pTab->keyConf, 0, 0, 0, 0,
                        SQLITE_IDXTYPE_PRIMARYKEY);
-    if( db->mallocFailed || pParse->nErr ) return;
+    if( db->mallocFailed || pParse->nErr ){
+      pTab->tabFlags &= ~TF_WithoutRowid;
+      return;
+    }
     pPk = sqlite3PrimaryKeyIndex(pTab);
     assert( pPk->nKeyCol==1 );
   }else{