-
Roy Lyseng authored
Bug#31947466: Assertion failure with GROUP_CONCAT(... ORDER BY). The problem is due to a too simple refactoring of Item_func_group_concat data structures in WL#9384. The important change here is moving the call to setup_order() from optimization to resolving. In order to do this, we needed to build a temporary "fields" list of the selected fields from the group concat. Likewise, a similar "fields" list is reconstructed in Item_func_group_concat::setup(), as it is required when creating the temporary table for evaluation of the group concat operation. There is one important simplification due to this: The ORDER struct contains pointers to an "initial" item and a "resolved" item. The initial item is the one passed from the parser, and the resolved one is either the same, or a substitution to a selected field. Earlier, we needed to rollback changes to the resolved item in Item_func_group_concat::cleanup() and restore it in the next execution round. This is no longer needed, and the code in cleanup() has been removed. Similar code for window functions has also been removed. Further on, the use of these two fields has been clarified slightly. Member item_ptr has been renamed to item_initial and made protected to highlight that it is not to be used during optimization and execution. The "item" member is also set to point to "item_initial" in the constructor, thus eliminating a few code lines. Since item_initial is now protected, a utility function to return whether the initial and the actual item pointer are the same has been added, called ORDER::is_item_original(). Some members have also been renamed for clarity and consistency: - arg_count_field is renamed to m_field_arg_count. - arg_count_order is renamed to m_order_arg_count. Reviewed by: Knut Anders Hatlen <knut.hatlen@oracle.com>
Roy Lyseng authoredBug#31947466: Assertion failure with GROUP_CONCAT(... ORDER BY). The problem is due to a too simple refactoring of Item_func_group_concat data structures in WL#9384. The important change here is moving the call to setup_order() from optimization to resolving. In order to do this, we needed to build a temporary "fields" list of the selected fields from the group concat. Likewise, a similar "fields" list is reconstructed in Item_func_group_concat::setup(), as it is required when creating the temporary table for evaluation of the group concat operation. There is one important simplification due to this: The ORDER struct contains pointers to an "initial" item and a "resolved" item. The initial item is the one passed from the parser, and the resolved one is either the same, or a substitution to a selected field. Earlier, we needed to rollback changes to the resolved item in Item_func_group_concat::cleanup() and restore it in the next execution round. This is no longer needed, and the code in cleanup() has been removed. Similar code for window functions has also been removed. Further on, the use of these two fields has been clarified slightly. Member item_ptr has been renamed to item_initial and made protected to highlight that it is not to be used during optimization and execution. The "item" member is also set to point to "item_initial" in the constructor, thus eliminating a few code lines. Since item_initial is now protected, a utility function to return whether the initial and the actual item pointer are the same has been added, called ORDER::is_item_original(). Some members have also been renamed for clarity and consistency: - arg_count_field is renamed to m_field_arg_count. - arg_count_order is renamed to m_order_arg_count. Reviewed by: Knut Anders Hatlen <knut.hatlen@oracle.com>
Loading