mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
MDEV-29972 Crash emitting "Unsupported meta-data version number" error message
row_import_read_meta_data(): Use ER_NOT_SUPPORTED_YET instead of ER_IO_READ_ERROR to have a matching error message pattern.
This commit is contained in:
parent
8dad51481b
commit
bd01029255
5 changed files with 36 additions and 12 deletions
BIN
mysql-test/std_data/mysql80/t2.cfg
Normal file
BIN
mysql-test/std_data/mysql80/t2.cfg
Normal file
Binary file not shown.
BIN
mysql-test/std_data/mysql80/t2.ibd
Normal file
BIN
mysql-test/std_data/mysql80/t2.ibd
Normal file
Binary file not shown.
|
@ -808,6 +808,18 @@ call mtr.add_suppression("InnoDB: unsupported MySQL tablespace");
|
|||
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||
ERROR 42000: Table 't1' uses an extension that doesn't exist in this MariaDB version
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 10.3 tests
|
||||
#
|
||||
# MDEV-29972 crash after "Unsupported meta-data version number"
|
||||
#
|
||||
call mtr.add_suppression("Index for table 't2' is corrupt");
|
||||
CREATE TABLE t2 (i INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
ALTER TABLE t2 DISCARD TABLESPACE;
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
ERROR 42000: This version of MariaDB doesn't yet support 'meta-data version'
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
ERROR HY000: Index for table 't2' is corrupt; try to repair it
|
||||
SELECT * FROM t2;
|
||||
ERROR HY000: Tablespace has been discarded for table `t2`
|
||||
DROP TABLE t2;
|
||||
# End of 10.4 tests
|
||||
|
|
|
@ -960,6 +960,25 @@ ALTER TABLE t1 IMPORT TABLESPACE;
|
|||
DROP TABLE t1;
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/t1.ibd
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.3 tests
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-29972 crash after "Unsupported meta-data version number"
|
||||
--echo #
|
||||
|
||||
call mtr.add_suppression("Index for table 't2' is corrupt");
|
||||
|
||||
CREATE TABLE t2 (i INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
ALTER TABLE t2 DISCARD TABLESPACE;
|
||||
--copy_file std_data/mysql80/t2.cfg $MYSQLD_DATADIR/test/t2.cfg
|
||||
--copy_file std_data/mysql80/t2.ibd $MYSQLD_DATADIR/test/t2.ibd
|
||||
--error ER_NOT_SUPPORTED_YET
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
--remove_file $MYSQLD_DATADIR/test/t2.cfg
|
||||
--error ER_NOT_KEYFILE
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
--error ER_TABLESPACE_DISCARDED
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2;
|
||||
|
||||
--echo # End of 10.4 tests
|
||||
|
|
|
@ -120,7 +120,6 @@ struct row_import {
|
|||
row_import() UNIV_NOTHROW
|
||||
:
|
||||
m_table(NULL),
|
||||
m_version(0),
|
||||
m_hostname(NULL),
|
||||
m_table_name(NULL),
|
||||
m_autoinc(0),
|
||||
|
@ -199,8 +198,6 @@ struct row_import {
|
|||
|
||||
dict_table_t* m_table; /*!< Table instance */
|
||||
|
||||
ulint m_version; /*!< Version of config file */
|
||||
|
||||
byte* m_hostname; /*!< Hostname where the
|
||||
tablespace was exported */
|
||||
byte* m_table_name; /*!< Exporting instance table
|
||||
|
@ -3090,17 +3087,13 @@ row_import_read_meta_data(
|
|||
return(DB_IO_ERROR);
|
||||
}
|
||||
|
||||
cfg.m_version = mach_read_from_4(row);
|
||||
|
||||
/* Check the version number. */
|
||||
switch (cfg.m_version) {
|
||||
switch (mach_read_from_4(row)) {
|
||||
case IB_EXPORT_CFG_VERSION_V1:
|
||||
|
||||
return(row_import_read_v1(file, thd, &cfg));
|
||||
default:
|
||||
ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR,
|
||||
"Unsupported meta-data version number (" ULINTPF "), "
|
||||
"file ignored", cfg.m_version);
|
||||
ib_senderrf(thd, IB_LOG_LEVEL_ERROR, ER_NOT_SUPPORTED_YET,
|
||||
"meta-data version");
|
||||
}
|
||||
|
||||
return(DB_ERROR);
|
||||
|
|
Loading…
Reference in a new issue