aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordan <Dan Kennedy>2021-04-15 19:09:19 +0000
committerdan <Dan Kennedy>2021-04-15 19:09:19 +0000
commit9988db83024e9e539ccd866c74694e5708a00e29 (patch)
tree352132cbbb538c7fdecb47e1df74119a925409f3 /src
parent37d4ec86bfa78c31732132b7729b8ce0e47da891 (diff)
downloadsqlite-9988db83024e9e539ccd866c74694e5708a00e29.tar.gz
sqlite-9988db83024e9e539ccd866c74694e5708a00e29.zip
Fix a bad interaction between constant propagation and transitive term handling causing patterns like "WHERE unlikely(t1.x=t1.y) AND t1.y=?" to return non-matching rows.
FossilOrigin-Name: 2363a14ca723c0343fbe350f6c19787a7a47c2289fd9af136c97a451b53b5226
Diffstat (limited to 'src')
-rw-r--r--src/where.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/where.c b/src/where.c
index 85579b592..3d60b175e 100644
--- a/src/where.c
+++ b/src/where.c
@@ -261,7 +261,9 @@ static void createMask(WhereMaskSet *pMaskSet, int iCursor){
*/
static Expr *whereRightSubexprIsColumn(Expr *p){
p = sqlite3ExprSkipCollateAndLikely(p->pRight);
- if( ALWAYS(p!=0) && p->op==TK_COLUMN ) return p;
+ if( ALWAYS(p!=0) && p->op==TK_COLUMN && !ExprHasProperty(p, EP_FixedCol) ){
+ return p;
+ }
return 0;
}