aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/resolve.c4
-rw-r--r--src/sqliteInt.h1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/resolve.c b/src/resolve.c
index 09108e3de..c564b8175 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -1257,7 +1257,7 @@ static int resolveOrderByTermToExprList(
nc.pParse = pParse;
nc.pSrcList = pSelect->pSrc;
nc.uNC.pEList = pEList;
- nc.ncFlags = NC_AllowAgg|NC_UEList;
+ nc.ncFlags = NC_AllowAgg|NC_UEList|NC_NoSelect;
nc.nNcErr = 0;
db = pParse->db;
savedSuppErr = db->suppressErr;
@@ -1864,7 +1864,7 @@ int sqlite3ResolveExprNames(
pNC->ncFlags &= ~(NC_HasAgg|NC_MinMaxAgg|NC_HasWin);
w.pParse = pNC->pParse;
w.xExprCallback = resolveExprStep;
- w.xSelectCallback = resolveSelectStep;
+ w.xSelectCallback = (pNC->ncFlags & NC_NoSelect) ? 0 : resolveSelectStep;
w.xSelectCallback2 = 0;
w.u.pNC = pNC;
#if SQLITE_MAX_EXPR_DEPTH>0
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index c90f4cac5..f4944c2ed 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -3098,6 +3098,7 @@ struct NameContext {
#define NC_IsDDL 0x10000 /* Resolving names in a CREATE statement */
#define NC_InAggFunc 0x20000 /* True if analyzing arguments to an agg func */
#define NC_FromDDL 0x40000 /* SQL text comes from sqlite_schema */
+#define NC_NoSelect 0x80000 /* Do not descend into sub-selects */
/*
** An instance of the following object describes a single ON CONFLICT