diff options
author | Chaithra Gopalareddy <chaithra.gopalareddy@oracle.com> | 2013-04-14 07:30:49 +0530 |
---|---|---|
committer | Chaithra Gopalareddy <chaithra.gopalareddy@oracle.com> | 2013-04-14 07:30:49 +0530 |
commit | 4db726c0fa37ae57054a1b2530a83c278b33f538 (patch) | |
tree | 9e76d4b51af2d6243ea3f195e0068ab5dfa61b17 /sql/sql_lex.h | |
parent | 84b942d103124e011023beb0a99751c0db9d6331 (diff) | |
download | mariadb-git-4db726c0fa37ae57054a1b2530a83c278b33f538.tar.gz |
Bug#16347426:ASSERTION FAILED: (SELECT_INSERT &&
!TABLES->NEXT_NAME_RESOLUTION_TABLE) || !TAB
Problem:
The context info of select query gets corrupted when a query
with group_concat having order by is present in an order by
clause of the select query. As a result, server crashes with
an assert.
Analysis:
While parsing order by for group_concat, it is presumed that
it is always present before the actual order by for the
select query.
As a result, parser uses select->order_list to populate the
order by items of group_concat and creates a select->gorder_list
to which select->order_list is copied onto. Once this is done,
it empties the select->order_list.
In the case presented in the bugpage, as order by is already
parsed when group_concat's order by is encountered, parser
presumes that it is the second order by in the select query
and creates fake_lex_unit which results in the change of
context info.
Solution:
Make group_concat's order by parsing independent of the select
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r-- | sql/sql_lex.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 0a054ced98a..2036707312a 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -628,7 +628,7 @@ public: const char *type; /* type of select for EXPLAIN */ SQL_I_List<ORDER> order_list; /* ORDER clause */ - SQL_I_List<ORDER> *gorder_list; + SQL_I_List<ORDER> gorder_list; Item *select_limit, *offset_limit; /* LIMIT clause parameters */ // Arrays of pointers to top elements of all_fields list Item **ref_pointer_array; @@ -763,6 +763,7 @@ public: bool add_group_to_list(THD *thd, Item *item, bool asc); bool add_ftfunc_to_list(Item_func_match *func); bool add_order_to_list(THD *thd, Item *item, bool asc); + bool add_gorder_to_list(THD *thd, Item *item, bool asc); TABLE_LIST* add_table_to_list(THD *thd, Table_ident *table, LEX_STRING *alias, ulong table_options, |