aboutsummaryrefslogtreecommitdiff
path: root/src/delete.c
diff options
context:
space:
mode:
authordrh <>2023-03-15 17:58:51 +0000
committerdrh <>2023-03-15 17:58:51 +0000
commitffcad5893aa40c52629d02851b05de20cee60f0d (patch)
tree47831f5b2c696dac1b080b3cfd7d8596627e1092 /src/delete.c
parenteb5d71ed58ce1b5b9a68c928f48063e4e3969467 (diff)
downloadsqlite-ffcad5893aa40c52629d02851b05de20cee60f0d.tar.gz
sqlite-ffcad5893aa40c52629d02851b05de20cee60f0d.zip
Disallow the one-pass optimization for DELETE if the WHERE clause contains
a subquery. Fix for the problem reported by [forum:/forumpost/e61252062c9d286d|forum post e61252062c9d286d]. This fix is more restrictive than necessary. It could be relaxed if the subquery does not involve the table that is the subject of the DELETE. FossilOrigin-Name: 73f0036f045bf37193b6e87ae45b578c5831614c530488257c69666178da3aa5
Diffstat (limited to 'src/delete.c')
-rw-r--r--src/delete.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/delete.c b/src/delete.c
index 704a3c711..22ef7ab65 100644
--- a/src/delete.c
+++ b/src/delete.c
@@ -483,7 +483,7 @@ void sqlite3DeleteFrom(
#endif /* SQLITE_OMIT_TRUNCATE_OPTIMIZATION */
{
u16 wcf = WHERE_ONEPASS_DESIRED|WHERE_DUPLICATES_OK;
- if( sNC.ncFlags & NC_VarSelect ) bComplex = 1;
+ if( sNC.ncFlags & NC_Subquery ) bComplex = 1;
wcf |= (bComplex ? 0 : WHERE_ONEPASS_MULTIROW);
if( HasRowid(pTab) ){
/* For a rowid table, initialize the RowSet to an empty set */