Do not segfault after a parse error in a sub-select in a statement of the form "DELETE WHERE ... IN(sub-select)". Ticket #2991. (CVS 4854)
FossilOrigin-Name: 3f9f81e908aad6cdc0a16ec52f4ec46d89fd78bc
diff --git a/src/expr.c b/src/expr.c
index b9cdce1..ed57641 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -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.353 2008/03/10 14:12:53 drh Exp $
+** $Id: expr.c,v 1.354 2008/03/12 10:39:00 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -1577,7 +1577,7 @@
&& (p=pX->pSelect)!=0 && !p->pPrior
&& !p->isDistinct && !p->isAgg && !p->pGroupBy
&& p->pSrc && p->pSrc->nSrc==1 && !p->pSrc->a[0].pSelect
- && !p->pSrc->a[0].pTab->pSelect
+ && p->pSrc->a[0].pTab && !p->pSrc->a[0].pTab->pSelect
&& p->pEList->nExpr==1 && p->pEList->a[0].pExpr->op==TK_COLUMN
&& !p->pLimit && !p->pOffset && !p->pWhere
){