]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix the ".lint fkey-indexes" shell command so that it works with WITHOUT ROWID
authordan <dan@noemail.net>
Fri, 1 Dec 2017 18:40:18 +0000 (18:40 +0000)
committerdan <dan@noemail.net>
Fri, 1 Dec 2017 18:40:18 +0000 (18:40 +0000)
tables.

FossilOrigin-Name: 5771b1d611b3562ea6c040f3f893073c4d0ee58c35b37ae211520d9aee8ed547

manifest
manifest.uuid
src/shell.c.in
test/shell6.test

index d7cb47fa84f75c27868fe46ec259dd26f178ef1c..59176fbb68f4e4b259b39f2dde20d9044ca53329 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\ssome\sminor\sproblems\sin\stest\sscripts.
-D 2017-11-30T11:21:59.935
+C Fix\sthe\s".lint\sfkey-indexes"\sshell\scommand\sso\sthat\sit\sworks\swith\sWITHOUT\sROWID\ntables.
+D 2017-12-01T18:40:18.535
 F Makefile.in 6a879cbf01e37f9eac131414955f71774b566502d9a57ded1b8585b507503cb8
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc e5d7606238f55816da99f719969598df5b091aa2e9a6935c9412fcae8f53fc44
@@ -472,7 +472,7 @@ F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384
 F src/resolve.c bbee7e31d369a18a2f4836644769882e9c5d40ef4a3af911db06410b65cb3730
 F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac
 F src/select.c 17e220191860a64a18c084141e1a8b7309e166a6f2d42c02021af27ea080d157
-F src/shell.c.in c441d7ddfbb8120cd8a7cde838ca5c9167311a7e400b1077c3ae6090aa420be8
+F src/shell.c.in 6ffed0c589f5aff180789a8c8abf5b2d3e2eea7470c86b30e797887cb0c9d0e5
 F src/sqlite.h.in 8fd97993d48b50b9bade38c52f12d175942c9497c960905610c7b03a3e4b5818
 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
 F src/sqlite3ext.h c02d628cca67f3889c689d82d25c3eb45e2c155db08e4c6089b5840d64687d34
@@ -1210,7 +1210,7 @@ F test/shell2.test e242a9912f44f4c23c3d1d802a83e934e84c853b
 F test/shell3.test 9b95ba643eaa228376f06a898fb410ee9b6e57c1
 F test/shell4.test 89ad573879a745974ff2df20ff97c5d6ffffbd5d
 F test/shell5.test 23939a4c51f0421330ea61dbd3c74f9c215f5f8d3d1a94846da6ffc777a35458
-F test/shell6.test ab1592ebe881371f651f18ee6a0df21cbfb5310f88cb832ab642d4038f679772
+F test/shell6.test 1ceb51b2678c472ba6cf1e5da96679ce8347889fe2c3bf93a0e0fa73f00b00d3
 F test/shell7.test 115132f66d0463417f408562cc2cf534f6bbc6d83a6d50f0072a9eb171bae97f
 F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3
 F test/show_speedtest1_rtree.tcl 32e6c5f073d7426148a6936a0408f4b5b169aba5
@@ -1679,7 +1679,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 64e567009dd56ef595850fe460925bc15fa875163541527638b654aa2b2cf785
-R bcb5dee584d5b6628891c4aa47c39d94
+P 4c551fdebc7feda3dcfeec719387d879cd5e2cbe213c0c1aac0a965b3f9e882d
+R 16fbfec98373820063ea860cc1009c10
 U dan
-Z 7f9d49097c1baf2fffb084b71e5e24bc
+Z b7aa606a2d2373a4fc095d067f4d9e36
index 42170c45839b8fc9ab7922360bcb17c9310d5db7..01389c8854c415a5acf6e7e06664cba9f18445c2 100644 (file)
@@ -1 +1 @@
-4c551fdebc7feda3dcfeec719387d879cd5e2cbe213c0c1aac0a965b3f9e882d
\ No newline at end of file
+5771b1d611b3562ea6c040f3f893073c4d0ee58c35b37ae211520d9aee8ed547
\ No newline at end of file
index daa887ef5d9b99b72d28a81d726b808ae5d0e0ec..062f76e4751e9a948877233a8d36c6974fb5ddbb 100644 (file)
@@ -3895,10 +3895,10 @@ static int lintFkeyIndexes(
   **
   ** 0. The text of an SQL statement similar to:
   **
-  **      "EXPLAIN QUERY PLAN SELECT rowid FROM child_table WHERE child_key=?"
+  **      "EXPLAIN QUERY PLAN SELECT 1 FROM child_table WHERE child_key=?"
   **
-  **    This is the same SELECT that the foreign keys implementation needs
-  **    to run internally on child tables. If there is an index that can
+  **    This SELECT is similar to the one that the foreign keys implementation
+  **    needs to run internally on child tables. If there is an index that can
   **    be used to optimize this query, then it can also be used by the FK
   **    implementation to optimize DELETE or UPDATE statements on the parent
   **    table.
@@ -3926,7 +3926,7 @@ static int lintFkeyIndexes(
   */
   const char *zSql =
   "SELECT "
-    "     'EXPLAIN QUERY PLAN SELECT rowid FROM ' || quote(s.name) || ' WHERE '"
+    "     'EXPLAIN QUERY PLAN SELECT 1 FROM ' || quote(s.name) || ' WHERE '"
     "  || group_concat(quote(s.name) || '.' || quote(f.[from]) || '=?' "
     "  || fkey_collate_clause("
     "       f.[table], COALESCE(f.[to], p.[name]), s.name, f.[from]),' AND ')"
index 25bfa32338eb83b01b648756a2a0893ae90611c5..49b4cc334413dd153a7e9548fa3bbec3e6a57cc6 100644 (file)
@@ -93,6 +93,14 @@ foreach {tn schema output} {
   } {
   }
 
+  10 {
+    CREATE TABLE parent (id INTEGER PRIMARY KEY); 
+    CREATE TABLE child2 (id INT PRIMARY KEY, parentID INT REFERENCES parent) 
+      WITHOUT ROWID;
+  } {
+    CREATE INDEX 'child2_parentID' ON 'child2'('parentID'); --> parent(id)
+  }
+
 } {
   forcedelete test.db
   sqlite3 db test.db