]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
When processing FK constraints on changes to parent tables, make sure the
authordrh <drh@noemail.net>
Mon, 12 Oct 2009 20:01:49 +0000 (20:01 +0000)
committerdrh <drh@noemail.net>
Mon, 12 Oct 2009 20:01:49 +0000 (20:01 +0000)
names of child tables appear correctly in the output of EXPLAIN QUERY PLAN.

FossilOrigin-Name: a4ab5215fed231c8e5f8714f5cadafd1209b362a

manifest
manifest.uuid
src/fkey.c

index da16e24d69d5a52998c92111821321780622d3aa..21c0be2c37185d1913b7e68c2b8a573251d228ad 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,8 @@
-C Add\smore\stest\scases\sto\se_fkey.test.
-D 2009-10-12T18:57:20
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+C When\sprocessing\sFK\sconstraints\son\schanges\sto\sparent\stables,\smake\ssure\sthe\nnames\sof\schild\stables\sappear\scorrectly\sin\sthe\soutput\sof\sEXPLAIN\sQUERY\sPLAN.
+D 2009-10-12T20:01:50
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 4ca3f1dd6efa2075bcb27f4dc43eef749877740d
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -116,7 +119,7 @@ F src/date.c 657ff12ca0f1195b531561afacbb38b772d16638
 F src/delete.c 308e300d599d2d11b838687e2cf7309d42f29a1a
 F src/expr.c c7f3f718bd5c392344ec8694a41c1824f30cf375
 F src/fault.c dc88c821842157460750d2d61a8a8b4197d047ff
-F src/fkey.c 6d27707f8163ea5325cb73be146a561b6d7b60cf
+F src/fkey.c 2b79b3851b6f12104ab1d9f63566a117728926e2
 F src/func.c e536218d193b8d326aab91120bc4c6f28aa2b606
 F src/global.c 271952d199a8cc59d4ce840b3bbbfd2f30c8ba32
 F src/hash.c ebcaa921ffd9d86f7ea5ae16a0a29d1c871130a7
@@ -756,7 +759,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 171c67138527750ec4af403f05389fae5f7da7b5
-R 5a583fc9c05004483dd8faaeb274030f
-U dan
-Z f39171edab73c7d5cf8e2d10e425e90b
+P 5633cb2b5b91a54e677dde76e31e319cd7d51780
+R bbf4996fcde5fed7535634c628dbe80e
+U drh
+Z ca40e99b9f3c91922320c8e8c4d2d4d4
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.6 (GNU/Linux)
+
+iD8DBQFK04sxoxKgR168RlERAmiVAJwP98j7ZksNarQBrEoSyQpXdMhFawCeNsx6
+Fz9yjd/luwPASc49P+Yopuk=
+=NY9x
+-----END PGP SIGNATURE-----
index 01f773f937192c623b3f956bd6fbb4b1619b663e..b6b786996b353b04ec8e121ba2a12b3341da0fdd 100644 (file)
@@ -1 +1 @@
-5633cb2b5b91a54e677dde76e31e319cd7d51780
\ No newline at end of file
+a4ab5215fed231c8e5f8714f5cadafd1209b362a
\ No newline at end of file
index abe2f5cc1ab7707614294e06f80c71695aa94b03..55d0a4f92dcf523ee6654019d012ddfa4c1619a6 100644 (file)
@@ -795,9 +795,11 @@ void sqlite3FkCheck(
     ** is required for the sqlite3WhereXXX() interface.  */
     pSrc = sqlite3SrcListAppend(db, 0, 0, 0);
     if( pSrc ){
-      pSrc->a->pTab = pFKey->pFrom;
-      pSrc->a->pTab->nRef++;
-      pSrc->a->iCursor = pParse->nTab++;
+      struct SrcList_item *pItem = pSrc->a;
+      pItem->pTab = pFKey->pFrom;
+      pItem->zName = pFKey->pFrom->zName;
+      pItem->pTab->nRef++;
+      pItem->iCursor = pParse->nTab++;
   
       if( regNew!=0 ){
         fkScanChildren(pParse, pSrc, pTab, pIdx, pFKey, aiCol, regNew, -1);
@@ -811,7 +813,7 @@ void sqlite3FkCheck(
         ** using OE_None). NO ACTION is the default.  */
         fkScanChildren(pParse, pSrc, pTab, pIdx, pFKey, aiCol, regOld, 1);
       }
-  
+      pItem->zName = 0;
       sqlite3SrcListDelete(db, pSrc);
     }
     sqlite3DbFree(db, aiCol);