diff options
author | Sergei Golubchik <sergii@pisem.net> | 2012-04-10 08:28:13 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2012-04-10 08:28:13 +0200 |
commit | 16c5c53fc21b162844c38a87ac48205448ca1d2f (patch) | |
tree | 7a50437d5f9da772ec8aaacab322e5f6c13e7305 /sql/sql_lex.h | |
parent | f860b2aad41cd1b5ed0438ea211dcd78eec82b94 (diff) | |
parent | ed418461614d912fbb114053508b3fb09b1fc2f0 (diff) | |
download | mariadb-git-16c5c53fc21b162844c38a87ac48205448ca1d2f.tar.gz |
mysql 5.5.23 merge
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r-- | sql/sql_lex.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 7e4d76b4240..f1ee6cf22ec 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -24,6 +24,7 @@ #include "sql_trigger.h" #include "item.h" /* From item_subselect.h: subselect_union_engine */ #include "thr_lock.h" /* thr_lock_type, TL_UNLOCK */ +#include "mem_root_array.h" /* YACC and LEX Definitions */ @@ -261,6 +262,7 @@ enum enum_drop_mode #define TL_OPTION_ALIAS 8 typedef List<Item> List_item; +typedef Mem_root_array<ORDER*, true> Group_list_ptrs; /* SERVERS CACHE CHANGES */ typedef struct st_lex_server_options @@ -735,7 +737,16 @@ public: enum olap_type olap; /* FROM clause - points to the beginning of the TABLE_LIST::next_local list. */ SQL_I_List<TABLE_LIST> table_list; - SQL_I_List<ORDER> group_list; /* GROUP BY clause. */ + + /* + GROUP BY clause. + This list may be mutated during optimization (by remove_const()), + so for prepared statements, we keep a copy of the ORDER.next pointers in + group_list_ptrs, and re-establish the original list before each execution. + */ + SQL_I_List<ORDER> group_list; + Group_list_ptrs *group_list_ptrs; + List<Item> item_list; /* list of fields & expressions */ List<String> interval_list; bool is_item_list_lookup; @@ -941,7 +952,8 @@ public: bool test_limit(); friend void lex_start(THD *thd); - st_select_lex() : n_sum_items(0), n_child_sum_items(0) {} + st_select_lex() : group_list_ptrs(NULL), n_sum_items(0), n_child_sum_items(0) + {} void make_empty_select() { init_query(); |