diff options
author | Anel Husakovic <anel@mariadb.org> | 2023-04-01 02:14:39 +0200 |
---|---|---|
committer | Anel Husakovic <anel@mariadb.org> | 2023-04-03 11:40:09 +0200 |
commit | 47d6d23fe4c49148c43cb775b012cb0069c79762 (patch) | |
tree | 16e6ab88202f0838dac1c4a58fb460d04c350a24 | |
parent | 8f8c95f46f51909bf73471c8aba5d51ba49f8253 (diff) | |
download | mariadb-git-bb-10.10-anel.tar.gz |
MDEV-28351 Assertion `this->file->children_attached' failed in ha_myisammrg::infobb-10.10-anel
- Thanks monty@mariadb.org for this commit
-rw-r--r-- | mysql-test/main/information_schema_db.result | 16 | ||||
-rw-r--r-- | mysql-test/main/information_schema_db.test | 12 | ||||
-rw-r--r-- | sql/sql_show.cc | 20 |
3 files changed, 45 insertions, 3 deletions
diff --git a/mysql-test/main/information_schema_db.result b/mysql-test/main/information_schema_db.result index 4ed2a23b0e9..7d899cc26b3 100644 --- a/mysql-test/main/information_schema_db.result +++ b/mysql-test/main/information_schema_db.result @@ -352,7 +352,7 @@ show create table t; Table Create Table t CREATE TEMPORARY TABLE `t` ( `t` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci disconnect con2; # Give the privileges to the user connection default; @@ -373,7 +373,7 @@ show create table t; Table Create Table t CREATE TEMPORARY TABLE `t` ( `t` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci show warnings; Level Code Message disconnect con2; @@ -383,3 +383,15 @@ drop table t; drop user foo@localhost; drop database some_db; use test; +# +# MDEV-28351 Assertion `this->file->children_attached' failed in ha_myisammrg::info +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +insert into t1 values (1); +CREATE TEMPORARY TABLE t2 (a INT) ENGINE=MERGE UNION=(t1); +CREATE TABLE t3 (a INT) ENGINE=MERGE UNION=(t1); +SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test'; +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 +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 +def test t1 BASE TABLE MyISAM 10 Fixed 1 7 X X X X NULL X X NULL latin1_swedish_ci NULL X N +DROP TABLE t1,t2,t3; diff --git a/mysql-test/main/information_schema_db.test b/mysql-test/main/information_schema_db.test index a4d69789865..fa9099f494f 100644 --- a/mysql-test/main/information_schema_db.test +++ b/mysql-test/main/information_schema_db.test @@ -347,3 +347,15 @@ drop table t; drop user foo@localhost; drop database some_db; use test; + +--echo # +--echo # MDEV-28351 Assertion `this->file->children_attached' failed in ha_myisammrg::info +--echo # + +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +insert into t1 values (1); +CREATE TEMPORARY TABLE t2 (a INT) ENGINE=MERGE UNION=(t1); +CREATE TABLE t3 (a INT) ENGINE=MERGE UNION=(t1); +--replace_column 10 X 11 X 12 X 13 X 15 X 16 X 22 X +SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test'; +DROP TABLE t1,t2,t3; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 0acf0c8acb7..ea9bd7cbaed 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -5338,7 +5338,25 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) fill_schema_table_names(thd, tables, &tmp_tbl->s->db, &tmp_tbl->s->table_name, true); else - process_i_s_table_temporary_tables(thd, table, tmp_tbl); + { + if (tmp_tbl->file->ha_table_flags() & HA_CAN_MULTISTEP_MERGE) + { + /* + MyISAM MERGE table. We have to to call open on it and it's + children + */ + LEX_CSTRING table_name= + { tmp_tbl->alias.ptr(), tmp_tbl->alias.length() }; + if (fill_schema_table_by_open(thd, &tmp_mem_root, FALSE, + table, schema_table, + &tmp_tbl->s->db, &table_name, + &open_tables_state_backup, + 0)) + goto err; + } + else + process_i_s_table_temporary_tables(thd, table, tmp_tbl); + } break; } } |