If there are already 500 or more simple SELECTs in a query, do not add more by flattening UNION ALL sub-queries into parent join queries.
FossilOrigin-Name: 9520bed2bd87dc56543ee58123323d293e960ecd84707b77f15f41669a2c9c3d
This commit is contained in:
parent
42470513b7
commit
51ddfef74d
12
manifest
12
manifest
@ -1,5 +1,5 @@
|
||||
C Fix\sa\sproblem\sin\ssqldiff\svirtual\stable\shanlding\sto\sdo\swith\stab\sand\sother\snon-space\swhitespace\scharacters\sin\sthe\sCREATE\sVIRTUAL\sTABLE\sstatement.
|
||||
D 2021-03-17T11:25:42.193
|
||||
C If\sthere\sare\salready\s500\sor\smore\ssimple\sSELECTs\sin\sa\squery,\sdo\snot\sadd\smore\sby\sflattening\sUNION\sALL\ssub-queries\sinto\sparent\sjoin\squeries.
|
||||
D 2021-03-17T14:29:37.603
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
@ -542,7 +542,7 @@ F src/printf.c 2b03a80d7c11bb422115dca175a18bf430e9c9dbaa0eee63b758f0c022f8f34f
|
||||
F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384
|
||||
F src/resolve.c dd47248c2c914feb0d4428c27d782e2723971d32cfa5536f49306d080df4d45a
|
||||
F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92
|
||||
F src/select.c fc904a7aa7ebfd5c7a57a0141d829c9f5388ac7773e0d1d9668768c1bbc87fc3
|
||||
F src/select.c e9c9c78567745b958a22d3f2bed054ec2ce0d67837cbd1c4faf3d9a660464a0b
|
||||
F src/shell.c.in 8df3912a7ca4873a1443d4adef1b25baee8c086ab479fd9c4f13ab03f98049ab
|
||||
F src/sqlite.h.in 3426a080ea1f222a73e3bd91e7eacbd30570a0117c03d42c6dde606f33e5e318
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
@ -1910,7 +1910,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 1734c332e7f609769fc30f82cf7af097c2964e08900ee3e297f6a25e6df60555
|
||||
R 83313da3f8929ffe9d0ca9cc05a1ce38
|
||||
P 1737e4fdfc9a3628415b234338a68a64cbbaadb23598517761e571ab7ed7ad14
|
||||
R 8c58aa13916791fb5364f91b2d4478a9
|
||||
U dan
|
||||
Z d615638e73fe2252aa958c3bc8bb6a2b
|
||||
Z e82f61f6b1d596f3a228da08a334106b
|
||||
|
@ -1 +1 @@
|
||||
1737e4fdfc9a3628415b234338a68a64cbbaadb23598517761e571ab7ed7ad14
|
||||
9520bed2bd87dc56543ee58123323d293e960ecd84707b77f15f41669a2c9c3d
|
@ -4039,6 +4039,7 @@ static int flattenSubquery(
|
||||
if( (p->selFlags & SF_Recursive) ) return 0;
|
||||
|
||||
if( pSrc->nSrc>1 ){
|
||||
if( pParse->nSelect>500 ) return 0;
|
||||
aCsrMap = sqlite3DbMallocZero(db, pParse->nTab*sizeof(int));
|
||||
}
|
||||
}
|
||||
@ -4115,6 +4116,7 @@ static int flattenSubquery(
|
||||
if( pNew==0 ){
|
||||
p->pPrior = pPrior;
|
||||
}else{
|
||||
pNew->selId = ++pParse->nSelect;
|
||||
if( aCsrMap && db->mallocFailed==0 ){
|
||||
renumberCursors(pParse, pNew, iFrom, aCsrMap);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user