Only consider AS names from the result set as candidates for resolving
identifiers in the WHERE clause if there are no other matches. In the
ORDER BY clause, AS names take priority over any column names.
Candidate fix for ticket [2500cdb9be].
FossilOrigin-Name: ad53924dcadffb95c6497c46c228c67e8f5370e4
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index a528e37..264db39 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -2079,6 +2079,8 @@
#define NC_HasAgg 0x02 /* One or more aggregate functions seen */
#define NC_IsCheck 0x04 /* True if resolving names in a CHECK constraint */
#define NC_InAggFunc 0x08 /* True if analyzing arguments to an agg func */
+#define NC_AsMaybe 0x10 /* Resolve to AS terms of the result set only
+ ** if no other resolution is available */
/*
** An instance of the following structure contains all information