From: drh Date: Wed, 15 Apr 2015 06:45:13 +0000 (+0000) Subject: Fix a faulty assert() statement in the name resolver associated with the X-Git-Tag: version-3.8.10~130 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a43f02efc613826511132be78c9445e239f91ddd;p=thirdparty%2Fsqlite.git Fix a faulty assert() statement in the name resolver associated with the optimization that converts compound selects with ORDER BY COLLATE into subqueries. FossilOrigin-Name: c72324ef9243946550ae3d974826502b1cc5eb10 --- diff --git a/manifest b/manifest index 355bd09e61..b179c36ad3 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Correctly\shandle\sCOLLATE\soperators\sapplied\sto\sCOLLATE\soperators\sin\san\nORDER\sBY\sclause. -D 2015-04-15T05:57:50.327 +C Fix\sa\sfaulty\sassert()\sstatement\sin\sthe\sname\sresolver\sassociated\swith\sthe\noptimization\sthat\sconverts\scompound\sselects\swith\sORDER\sBY\sCOLLATE\sinto\nsubqueries. +D 2015-04-15T06:45:13.856 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5f78b1ab81b64e7c57a75d170832443e66c0880a F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -228,7 +228,7 @@ F src/pragma.h 09c89bca58e9a44de2116cc8272b8d454657129f F src/prepare.c 173a5a499138451b2561614ecb87d78f9f4644b9 F src/printf.c 08fa675c200aac29e561c6153f91f909ed17612f F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 -F src/resolve.c 03fe2a8640b7f1477e6cbca6f3bc1b5549263a47 +F src/resolve.c 66cfe49a9c3b449ef13b89a8c47036a4ed167eab F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/select.c 117e0f9ac9254a6f7472fac5144eba21ba0b2ec1 F src/shell.c 84a1593bd86aaa14f4da8a8f9b16fbc239d262aa @@ -849,7 +849,7 @@ F test/selectA.test e452bdb975f488ea46d091382a9185b5853ed2c7 F test/selectB.test 954e4e49cf1f896d61794e440669e03a27ceea25 F test/selectC.test 871fb55d884d3de5943c4057ebd22c2459e71977 F test/selectD.test b0f02a04ef7737decb24e08be2c39b9664b43394 -F test/selectE.test fc02a1eb04c8eb537091482644b7d778ae8759b7 +F test/selectE.test a8730ca330fcf40ace158f134f4fe0eb00c7edbf F test/selectF.test 21c94e6438f76537b72532fa9fd4710cdd455fc3 F test/selectG.test e8600e379589e85e9fefd2fe4d44a4cdd63f6982 F test/server1.test 46803bd3fe8b99b30dbc5ff38ffc756f5c13a118 @@ -1250,7 +1250,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 998cfdb8dcda2cac94b83326751e16dcef8b267f -R 365a6b3d3d3943322095f384b9ee1504 +P 9e1f837b08facbc7a2b6196770599a58233e725c +R d99053241fb4278349e47e2aa3bd86a0 U drh -Z eaf1d275b82a1bdf74f8de064c4444e7 +Z d2955d105f5f67e57ae3e9b26664c585 diff --git a/manifest.uuid b/manifest.uuid index a0184f5e23..3d0d30286b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9e1f837b08facbc7a2b6196770599a58233e725c \ No newline at end of file +c72324ef9243946550ae3d974826502b1cc5eb10 \ No newline at end of file diff --git a/src/resolve.c b/src/resolve.c index aa4cddfef2..6294ba26e1 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -1198,7 +1198,7 @@ static int resolveSelectStep(Walker *pWalker, Select *p){ ** after the names have been resolved. */ if( p->selFlags & SF_Converted ){ Select *pSub = p->pSrc->a[0].pSelect; - assert( p->pSrc->nSrc==1 && isCompound==0 && p->pOrderBy ); + assert( p->pSrc->nSrc==1 && p->pOrderBy ); assert( pSub->pPrior && pSub->pOrderBy==0 ); pSub->pOrderBy = p->pOrderBy; p->pOrderBy = 0; diff --git a/test/selectE.test b/test/selectE.test index d7592bbbc5..1cabeff370 100644 --- a/test/selectE.test +++ b/test/selectE.test @@ -92,4 +92,9 @@ do_test selectE-2.2 { } } {} +do_catchsql_test selectE-3.1 { + SELECT 1 EXCEPT SELECT 2 ORDER BY 1 COLLATE nocase EXCEPT SELECT 3; +} {1 {ORDER BY clause should come after EXCEPT not before}} + + finish_test