Loading mysql-test/r/information_schema.result +5 −0 Original line number Diff line number Diff line Loading @@ -610,3 +610,8 @@ create view v1 as select * from t1, t2; set @got_val= (select count(*) from information_schema.columns); drop view v1; drop table t1, t2; CREATE TABLE t_crashme ( f1 BIGINT); CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1; CREATE VIEW a2 AS SELECT t_CRASHME FROM a1; drop view a2, a1; drop table t_crashme; mysql-test/t/information_schema.test +27 −0 Original line number Diff line number Diff line Loading @@ -363,3 +363,30 @@ create view v1 as select * from t1, t2; set @got_val= (select count(*) from information_schema.columns); drop view v1; drop table t1, t2; # # Bug #7476: crash on SELECT * FROM INFORMATION_SCHEMA.TABLES # CREATE TABLE t_crashme ( f1 BIGINT); CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1; CREATE VIEW a2 AS SELECT t_CRASHME FROM a1; let $tab_count= 65; --disable_query_log while ($tab_count) { EVAL CREATE TABLE t_$tab_count (f1 BIGINT); dec $tab_count ; } --disable_result_log SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES; --enable_result_log let $tab_count= 65; while ($tab_count) { EVAL DROP TABLE t_$tab_count; dec $tab_count ; } --enable_query_log drop view a2, a1; drop table t_crashme; sql/sql_show.cc +6 −2 Original line number Diff line number Diff line Loading @@ -1778,6 +1778,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) LEX *lex= thd->lex; TABLE *table= tables->table; SELECT_LEX *select_lex= &lex->select_lex; SELECT_LEX *old_all_select_lex= lex->all_selects_list; SELECT_LEX *lsel= tables->schema_select_lex; ST_SCHEMA_TABLE *schema_table= tables->schema_table; SELECT_LEX sel; Loading @@ -1790,6 +1791,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) List<char> bases; List_iterator_fast<char> it(bases); COND *partial_cond; uint derived_tables= lex->derived_tables; int error= 1; DBUG_ENTER("get_all_tables"); Loading @@ -1814,7 +1816,6 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) goto err; } lex->all_selects_list= &sel; schema_table_idx= get_schema_table_idx(schema_table); lock_type= TL_UNLOCK; Loading Loading @@ -1911,6 +1912,8 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) goto err; TABLE_LIST *show_table_list= (TABLE_LIST*) sel.table_list.first; show_table_list->lock_type= lock_type; lex->all_selects_list= &sel; lex->derived_tables= 0; res= open_and_lock_tables(thd, show_table_list); if (schema_table->process_table(thd, show_table_list, table, res, base_name, Loading @@ -1930,7 +1933,8 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) error= 0; err: lex->all_selects_list= select_lex; lex->derived_tables= derived_tables; lex->all_selects_list= old_all_select_lex; DBUG_RETURN(error); } Loading Loading
mysql-test/r/information_schema.result +5 −0 Original line number Diff line number Diff line Loading @@ -610,3 +610,8 @@ create view v1 as select * from t1, t2; set @got_val= (select count(*) from information_schema.columns); drop view v1; drop table t1, t2; CREATE TABLE t_crashme ( f1 BIGINT); CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1; CREATE VIEW a2 AS SELECT t_CRASHME FROM a1; drop view a2, a1; drop table t_crashme;
mysql-test/t/information_schema.test +27 −0 Original line number Diff line number Diff line Loading @@ -363,3 +363,30 @@ create view v1 as select * from t1, t2; set @got_val= (select count(*) from information_schema.columns); drop view v1; drop table t1, t2; # # Bug #7476: crash on SELECT * FROM INFORMATION_SCHEMA.TABLES # CREATE TABLE t_crashme ( f1 BIGINT); CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1; CREATE VIEW a2 AS SELECT t_CRASHME FROM a1; let $tab_count= 65; --disable_query_log while ($tab_count) { EVAL CREATE TABLE t_$tab_count (f1 BIGINT); dec $tab_count ; } --disable_result_log SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES; --enable_result_log let $tab_count= 65; while ($tab_count) { EVAL DROP TABLE t_$tab_count; dec $tab_count ; } --enable_query_log drop view a2, a1; drop table t_crashme;
sql/sql_show.cc +6 −2 Original line number Diff line number Diff line Loading @@ -1778,6 +1778,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) LEX *lex= thd->lex; TABLE *table= tables->table; SELECT_LEX *select_lex= &lex->select_lex; SELECT_LEX *old_all_select_lex= lex->all_selects_list; SELECT_LEX *lsel= tables->schema_select_lex; ST_SCHEMA_TABLE *schema_table= tables->schema_table; SELECT_LEX sel; Loading @@ -1790,6 +1791,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) List<char> bases; List_iterator_fast<char> it(bases); COND *partial_cond; uint derived_tables= lex->derived_tables; int error= 1; DBUG_ENTER("get_all_tables"); Loading @@ -1814,7 +1816,6 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) goto err; } lex->all_selects_list= &sel; schema_table_idx= get_schema_table_idx(schema_table); lock_type= TL_UNLOCK; Loading Loading @@ -1911,6 +1912,8 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) goto err; TABLE_LIST *show_table_list= (TABLE_LIST*) sel.table_list.first; show_table_list->lock_type= lock_type; lex->all_selects_list= &sel; lex->derived_tables= 0; res= open_and_lock_tables(thd, show_table_list); if (schema_table->process_table(thd, show_table_list, table, res, base_name, Loading @@ -1930,7 +1933,8 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) error= 0; err: lex->all_selects_list= select_lex; lex->derived_tables= derived_tables; lex->all_selects_list= old_all_select_lex; DBUG_RETURN(error); } Loading