mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Disable the reuse of IN-clause subqueries if the subquery is an explicit
"SELECT ALL". The ALL keyword is almost never used in actual practice (most developers don't even know it can be used) so this should not interfere with the optimization, but it does give us a convenient way to turn it off for testing purposes. FossilOrigin-Name: a81299be2ce203dcc28e7d0ba24791cbfba80e1ee3e1564469a226cac8adb17d
This commit is contained in:
10
src/expr.c
10
src/expr.c
@@ -3439,6 +3439,8 @@ static int findCompatibleInRhsSubrtn(
|
||||
assert( pExpr->op==TK_IN );
|
||||
assert( !ExprUseYSub(pExpr) );
|
||||
assert( ExprUseXSelect(pExpr) );
|
||||
assert( pExpr->x.pSelect!=0 );
|
||||
assert( (pExpr->x.pSelect->selFlags & SF_All)==0 );
|
||||
v = pParse->pVdbe;
|
||||
assert( v!=0 );
|
||||
pOp = sqlite3VdbeGetOp(v, 1);
|
||||
@@ -3514,11 +3516,9 @@ void sqlite3CodeRhsOfIN(
|
||||
** Compute a signature for the RHS of the IN operator to facility
|
||||
** finding and reusing prior instances of the same IN operator.
|
||||
*/
|
||||
SubrtnSig *pSig;
|
||||
if( !ExprUseXSelect(pExpr) ){
|
||||
pSig = 0;
|
||||
}else{
|
||||
assert( pExpr->x.pSelect!=0 );
|
||||
SubrtnSig *pSig = 0;
|
||||
assert( !ExprUseXSelect(pExpr) || pExpr->x.pSelect!=0 );
|
||||
if( ExprUseXSelect(pExpr) && (pExpr->x.pSelect->selFlags & SF_All)==0 ){
|
||||
pSig = sqlite3DbMallocRawNN(pParse->db, sizeof(pSig[0]));
|
||||
if( pSig ){
|
||||
pSig->selId = pExpr->x.pSelect->selId;
|
||||
|
Reference in New Issue
Block a user