mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 10:14:19 +01:00
Bug#22413 EXPLAIN SELECT FROM view with ORDER BY yield server crash
disable filling of I_S tables for EXPLAIN
This commit is contained in:
parent
bcfed657e7
commit
ff38409128
3 changed files with 31 additions and 0 deletions
|
@ -1254,3 +1254,18 @@ COLUMN_NAME MD5(COLUMN_DEFAULT) LENGTH(COLUMN_DEFAULT) COLUMN_DEFAULT=get_value(
|
|||
fld1 7cf7a6782be951a1f2464a350da926a5 65532 1
|
||||
DROP TABLE bug23037;
|
||||
DROP FUNCTION get_value;
|
||||
create view v1 as
|
||||
select table_schema as object_schema,
|
||||
table_name as object_name,
|
||||
table_type as object_type
|
||||
from information_schema.tables
|
||||
order by object_schema;
|
||||
explain select * from v1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY <derived2> system NULL NULL NULL NULL 0 const row not found
|
||||
2 DERIVED tables ALL NULL NULL NULL NULL 2 Using filesort
|
||||
explain select * from (select table_name from information_schema.tables) as a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY <derived2> system NULL NULL NULL NULL 0 const row not found
|
||||
2 DERIVED tables ALL NULL NULL NULL NULL 2
|
||||
drop view v1;
|
||||
|
|
|
@ -973,4 +973,18 @@ DROP FUNCTION get_value;
|
|||
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Bug#22413: EXPLAIN SELECT FROM view with ORDER BY yield server crash
|
||||
#
|
||||
create view v1 as
|
||||
select table_schema as object_schema,
|
||||
table_name as object_name,
|
||||
table_type as object_type
|
||||
from information_schema.tables
|
||||
order by object_schema;
|
||||
explain select * from v1;
|
||||
explain select * from (select table_name from information_schema.tables) as a;
|
||||
drop view v1;
|
||||
|
||||
# End of 5.0 tests.
|
||||
|
|
|
@ -1471,6 +1471,7 @@ JOIN::exec()
|
|||
curr_join->examined_rows= 0;
|
||||
|
||||
if ((curr_join->select_lex->options & OPTION_SCHEMA_TABLE) &&
|
||||
!thd->lex->describe &&
|
||||
get_schema_tables_result(curr_join))
|
||||
{
|
||||
DBUG_VOID_RETURN;
|
||||
|
@ -12278,6 +12279,7 @@ create_sort_index(THD *thd, JOIN *join, ORDER *order,
|
|||
|
||||
/* Fill schema tables with data before filesort if it's necessary */
|
||||
if ((join->select_lex->options & OPTION_SCHEMA_TABLE) &&
|
||||
!thd->lex->describe &&
|
||||
get_schema_tables_result(join))
|
||||
goto err;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue