1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Move the query flattener turn-off from a pragma to an sqlite3_test_control()

call.  Make provisions (not yet implemented) to turn off other optimizers
using the same call.

FossilOrigin-Name: 4a97c623f4e190134de4b2ca406e311034a74797
This commit is contained in:
drh
2009-12-22 23:52:32 +00:00
parent 3540c1f7b8
commit 07096f68ae
8 changed files with 75 additions and 50 deletions

View File

@@ -2592,13 +2592,7 @@ static int flattenSubquery(
*/
assert( p!=0 );
assert( p->pPrior==0 ); /* Unable to flatten compound queries */
/* The "PRAGMA omit_flattener=ON" statement disables query flattening for
** testing purposes. The only reason to disable the query flattener is
** to verify that we get the same answer with and without the flattener.
** In production use, there is never a reason to turn the flattener off. */
if( db->flags & SQLITE_OmitFlattener ) return 0;
if( db->flags & SQLITE_QueryFlattener ) return 0;
pSrc = p->pSrc;
assert( pSrc && iFrom>=0 && iFrom<pSrc->nSrc );
pSubitem = &pSrc->a[iFrom];