summaryrefslogtreecommitdiff
path: root/sql/sql_lex.h
diff options
context:
space:
mode:
authorKaren Langford <karen.langford@oracle.com>2011-07-06 00:56:51 +0200
committerKaren Langford <karen.langford@oracle.com>2011-07-06 00:56:51 +0200
commitf6398a86dde400bc97009350c61dd9a9d3c1d715 (patch)
treeeefc26771a8f290ae8b29e9d7ecb41b19010a909 /sql/sql_lex.h
parentc2e8aacb3f4fa952d4a9f6757dad1654ec70f49b (diff)
parentae46a66099cfe66e9423a2cc9ef0c5e2097ae73d (diff)
downloadmariadb-git-f6398a86dde400bc97009350c61dd9a9d3c1d715.tar.gz
Merge from mysql-5.1.58-release
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r--sql/sql_lex.h28
1 files changed, 17 insertions, 11 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 07551f51a8a..b4dbbc5162e 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -715,16 +715,7 @@ public:
joins on the right.
*/
List<String> *prev_join_using;
- /*
- Bitmap used in the ONLY_FULL_GROUP_BY_MODE to prevent mixture of aggregate
- functions and non aggregated fields when GROUP BY list is absent.
- Bits:
- 0 - non aggregated fields are used in this select,
- defined as NON_AGG_FIELD_USED.
- 1 - aggregate functions are used in this select,
- defined as SUM_FUNC_USED.
- */
- uint8 full_group_by_flag;
+
void init_query();
void init_select();
st_select_lex_unit* master_unit();
@@ -832,7 +823,22 @@ public:
void clear_index_hints(void) { index_hints= NULL; }
-private:
+ /*
+ For MODE_ONLY_FULL_GROUP_BY we need to maintain two flags:
+ - Non-aggregated fields are used in this select.
+ - Aggregate functions are used in this select.
+ In MODE_ONLY_FULL_GROUP_BY only one of these may be true.
+ */
+ bool non_agg_field_used() const { return m_non_agg_field_used; }
+ bool agg_func_used() const { return m_agg_func_used; }
+
+ void set_non_agg_field_used(bool val) { m_non_agg_field_used= val; }
+ void set_agg_func_used(bool val) { m_agg_func_used= val; }
+
+private:
+ bool m_non_agg_field_used;
+ bool m_agg_func_used;
+
/* current index hint kind. used in filling up index_hints */
enum index_hint_type current_index_hint_type;
index_clause_map current_index_hint_clause;