mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-08 03:22:21 +03:00
When the left-hand side of an IN operator is constant and the right-hand
side is a SELECT, recognize that the IN operator is not constant. Ticket #1380. (CVS 2624) FossilOrigin-Name: fc9e04609b6968fc5039a6f9f808aac681f4fc41
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
** This file contains routines used for analyzing expressions and
|
||||
** for generating VDBE code that evaluates expressions in SQLite.
|
||||
**
|
||||
** $Id: expr.c,v 1.220 2005/08/24 16:54:05 drh Exp $
|
||||
** $Id: expr.c,v 1.221 2005/08/25 12:45:04 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <ctype.h>
|
||||
@@ -624,6 +624,8 @@ void sqlite3ExprListDelete(ExprList *pList){
|
||||
**
|
||||
** The return value from this routine is 1 to abandon the tree walk
|
||||
** and 0 to continue.
|
||||
**
|
||||
** NOTICE: This routine does *not* descend into subqueries.
|
||||
*/
|
||||
static int walkExprList(ExprList *, int (*)(void *, Expr*), void *);
|
||||
static int walkExprTree(Expr *pExpr, int (*xFunc)(void*,Expr*), void *pArg){
|
||||
@@ -696,6 +698,11 @@ static int exprNodeIsConstant(void *pArg, Expr *pExpr){
|
||||
#endif
|
||||
*((int*)pArg) = 0;
|
||||
return 2;
|
||||
case TK_IN:
|
||||
if( pExpr->pSelect ){
|
||||
*((int*)pArg) = 0;
|
||||
return 2;
|
||||
}
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user