diff options
author | dan <Dan Kennedy> | 2022-05-17 15:01:01 +0000 |
---|---|---|
committer | dan <Dan Kennedy> | 2022-05-17 15:01:01 +0000 |
commit | 5348fbe3322570f9fb3b1376cc8f7d25d74e3be3 (patch) | |
tree | 54b76d1eccfc2d1fc70208106993adceeea8114e /src | |
parent | ff16267d7da5ddbf1edb683d4524e5f8d7d7ae11 (diff) | |
download | sqlite-5348fbe3322570f9fb3b1376cc8f7d25d74e3be3.tar.gz sqlite-5348fbe3322570f9fb3b1376cc8f7d25d74e3be3.zip |
Avoid treating constant expressions like "? IN ()" or "? NOT IN ()" as integers if they appear in a GROUP BY or ORDER BY clause.
FossilOrigin-Name: d8b249e8cdf0babe1427d0587dbdc27a52ec06a5ef3a20dfb05a0ea4adb85858
Diffstat (limited to 'src')
-rw-r--r-- | src/parse.y | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/parse.y b/src/parse.y index 565130a05..fb3c3f38c 100644 --- a/src/parse.y +++ b/src/parse.y @@ -1271,7 +1271,8 @@ expr(A) ::= expr(A) between_op(N) expr(X) AND expr(Y). [BETWEEN] { ** regardless of the value of expr1. */ sqlite3ExprUnmapAndDelete(pParse, A); - A = sqlite3Expr(pParse->db, TK_INTEGER, N ? "1" : "0"); + A = sqlite3Expr(pParse->db, TK_STRING, N ? "true" : "false"); + if( A ) sqlite3ExprIdToTrueFalse(A); }else{ Expr *pRHS = Y->a[0].pExpr; if( Y->nExpr==1 && sqlite3ExprIsConstant(pRHS) && A->op!=TK_VECTOR ){ |