diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/delete.c | 2 | ||||
-rw-r--r-- | src/resolve.c | 1 | ||||
-rw-r--r-- | src/sqliteInt.h | 1 |
3 files changed, 3 insertions, 1 deletions
diff --git a/src/delete.c b/src/delete.c index 258b39cc3..06a016438 100644 --- a/src/delete.c +++ b/src/delete.c @@ -374,7 +374,7 @@ void sqlite3DeleteFrom( #endif /* SQLITE_OMIT_TRUNCATE_OPTIMIZATION */ { u16 wcf = WHERE_ONEPASS_DESIRED|WHERE_DUPLICATES_OK; - if( pWhere && ExprHasProperty(pWhere, EP_Subquery) ) bComplex = 1; + if( sNC.ncFlags & NC_VarSelect ) bComplex = 1; wcf |= (bComplex ? 0 : WHERE_ONEPASS_MULTIROW); if( HasRowid(pTab) ){ /* For a rowid table, initialize the RowSet to an empty set */ diff --git a/src/resolve.c b/src/resolve.c index 8e290af12..77ce37f6d 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -763,6 +763,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ assert( pNC->nRef>=nRef ); if( nRef!=pNC->nRef ){ ExprSetProperty(pExpr, EP_VarSelect); + pNC->ncFlags |= NC_VarSelect; } } break; diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 76bf80962..783f0f56c 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -2597,6 +2597,7 @@ struct NameContext { #define NC_InAggFunc 0x0008 /* True if analyzing arguments to an agg func */ #define NC_HasAgg 0x0010 /* One or more aggregate functions seen */ #define NC_IdxExpr 0x0020 /* True if resolving columns of CREATE INDEX */ +#define NC_VarSelect 0x0040 /* A correlated subquery has been seen */ #define NC_MinMaxAgg 0x1000 /* min/max aggregates seen. See note above */ /* |