Skip to content

Commit 91bfc76

Browse files
montywivuvova
authored andcommitted
MDEV-28351 Assertion `this->file->children_attached' failed in ha_myisammrg::info
Reviewed-by: <vicentiu@mariadb.org>
1 parent 1923ff8 commit 91bfc76

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

mysql-test/main/information_schema_temp_table.result

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,3 +200,17 @@ show index in t;
200200
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
201201
t 1 b 1 b A NULL NULL NULL YES BTREE NO
202202
drop database mysqltest;
203+
#
204+
# MDEV-28351 Assertion `this->file->children_attached' failed in ha_myisammrg::info
205+
#
206+
use test;
207+
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
208+
insert into t1 values (1);
209+
CREATE TEMPORARY TABLE t2 (a INT) ENGINE=MERGE UNION=(t1);
210+
CREATE TABLE t3 (a INT) ENGINE=MERGE UNION=(t1);
211+
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test';
212+
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT MAX_INDEX_LENGTH TEMPORARY
213+
def test tmp_innodb_in_test TEMPORARY InnoDB 10 Dynamic 0 0 X X X X NULL X X NULL latin1_swedish_ci NULL X Y
214+
def test t3 BASE TABLE MRG_MyISAM 10 Fixed 1 5 X X X X NULL X X NULL latin1_swedish_ci NULL X N
215+
def test t1 BASE TABLE MyISAM 10 Fixed 1 7 X X X X NULL X X NULL latin1_swedish_ci NULL X N
216+
DROP TABLE t1,t2,t3;

mysql-test/main/information_schema_temp_table.test

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,15 @@ show index in t;
195195

196196
# Cleanup
197197
drop database mysqltest;
198+
199+
--echo #
200+
--echo # MDEV-28351 Assertion `this->file->children_attached' failed in ha_myisammrg::info
201+
--echo #
202+
use test;
203+
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
204+
insert into t1 values (1);
205+
CREATE TEMPORARY TABLE t2 (a INT) ENGINE=MERGE UNION=(t1);
206+
CREATE TABLE t3 (a INT) ENGINE=MERGE UNION=(t1);
207+
--replace_column 10 X 11 X 12 X 13 X 15 X 16 X 22 X
208+
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test';
209+
DROP TABLE t1,t2,t3;

sql/sql_show.cc

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5370,7 +5370,23 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
53705370
}
53715371
else /* SCH_TABLE */
53725372
{
5373-
process_i_s_table_temporary_tables(thd, table, tmp_tbl);
5373+
if (tmp_tbl->file->ha_table_flags() & HA_CAN_MULTISTEP_MERGE)
5374+
{
5375+
/*
5376+
MyISAM MERGE table. We have to to call open on it and its
5377+
children
5378+
*/
5379+
LEX_CSTRING table_name=
5380+
{ tmp_tbl->alias.ptr(), tmp_tbl->alias.length() };
5381+
if (fill_schema_table_by_open(thd, &tmp_mem_root, FALSE,
5382+
table, schema_table,
5383+
&tmp_tbl->s->db, &table_name,
5384+
&open_tables_state_backup,
5385+
0))
5386+
goto err;
5387+
}
5388+
else
5389+
process_i_s_table_temporary_tables(thd, table, tmp_tbl);
53745390
}
53755391
}
53765392
}

0 commit comments

Comments
 (0)