Bug#24630 Subselect query crashes mysqld
The crash happens because second filling of the same I_S table happens in case of subselect with order by. table->sort.io_cache previously allocated in create_sort_index() is deleted during second filling (function get_schema_tables_result). There are two places where I_S table can be filled: JOIN::exec and create_sort_index(). To fix the bug we should check if the table was already filled in one of these places and skip processing of the table in second. mysql-test/r/information_schema.result: test case mysql-test/t/information_schema.test: test case sql/mysql_priv.h: added new parameter 'executed_place' to function get_schema_tables_result() sql/sql_select.cc: added new parameter 'executed_place' to function get_schema_tables_result() sql/sql_show.cc: added more accurate check for cases when we need to refresh I_S table sql/table.cc: added more accurate check for cases when we need to refresh I_S table sql/table.h: added more accurate check for cases when we need to refresh I_S table
Showing
Please register or sign in to comment