mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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
This commit is contained in:
@ -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
|
||||
@ -1920,6 +1920,11 @@ bool st_select_lex::add_order_to_list(THD *thd, Item *item, bool asc)
|
||||
}
|
||||
|
||||
|
||||
bool st_select_lex::add_gorder_to_list(THD *thd, Item *item, bool asc)
|
||||
{
|
||||
return add_to_list(thd, gorder_list, item, asc);
|
||||
}
|
||||
|
||||
bool st_select_lex::add_item_to_list(THD *thd, Item *item)
|
||||
{
|
||||
DBUG_ENTER("st_select_lex::add_item_to_list");
|
||||
|
Reference in New Issue
Block a user