mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-21454 Show actual mismatching values in mismatch error messages from row_import::match_table_columns()
Patch by Hartmut Holzgraefe
This commit is contained in:
@@ -389,7 +389,7 @@ CREATE TABLE testdb_wl5522.t1 ( i bigint) ENGINE = Innodb;
|
|||||||
ALTER TABLE testdb_wl5522.t1 DISCARD TABLESPACE;
|
ALTER TABLE testdb_wl5522.t1 DISCARD TABLESPACE;
|
||||||
restore: t1 .ibd and .cfg files
|
restore: t1 .ibd and .cfg files
|
||||||
ALTER TABLE testdb_wl5522.t1 IMPORT TABLESPACE;
|
ALTER TABLE testdb_wl5522.t1 IMPORT TABLESPACE;
|
||||||
ERROR HY000: Schema mismatch (Column i precise type mismatch.)
|
ERROR HY000: Schema mismatch (Column i precise type mismatch, it's 0X408 in the table and 0X403 in the tablespace meta file)
|
||||||
unlink: t1.ibd
|
unlink: t1.ibd
|
||||||
unlink: t1.cfg
|
unlink: t1.cfg
|
||||||
DROP TABLE testdb_wl5522.t1;
|
DROP TABLE testdb_wl5522.t1;
|
||||||
|
@@ -426,7 +426,7 @@ SELECT * FROM t1;
|
|||||||
ERROR HY000: Tablespace has been discarded for table `t1`
|
ERROR HY000: Tablespace has been discarded for table `t1`
|
||||||
restore: t1 .ibd and .cfg files
|
restore: t1 .ibd and .cfg files
|
||||||
ALTER TABLE t1 IMPORT TABLESPACE;
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
ERROR HY000: Schema mismatch (Column c2 precise type mismatch.)
|
ERROR HY000: Schema mismatch (Column c2 precise type mismatch, it's 0X408 in the table and 0X403 in the tablespace meta file)
|
||||||
unlink: t1.ibd
|
unlink: t1.ibd
|
||||||
unlink: t1.cfg
|
unlink: t1.cfg
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
@@ -410,7 +410,7 @@ SELECT * FROM t1;
|
|||||||
ERROR HY000: Tablespace has been discarded for table `t1`
|
ERROR HY000: Tablespace has been discarded for table `t1`
|
||||||
restore: t1 .ibd and .cfg files
|
restore: t1 .ibd and .cfg files
|
||||||
ALTER TABLE t1 IMPORT TABLESPACE;
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
ERROR HY000: Schema mismatch (Column c2 precise type mismatch.)
|
ERROR HY000: Schema mismatch (Column c2 precise type mismatch, it's 0X408 in the table and 0X403 in the tablespace meta file)
|
||||||
unlink: t1.ibd
|
unlink: t1.ibd
|
||||||
unlink: t1.cfg
|
unlink: t1.cfg
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
@@ -1154,60 +1154,82 @@ row_import::match_table_columns(
|
|||||||
|
|
||||||
if (cfg_col->prtype != col->prtype) {
|
if (cfg_col->prtype != col->prtype) {
|
||||||
ib_errf(thd,
|
ib_errf(thd,
|
||||||
IB_LOG_LEVEL_ERROR,
|
IB_LOG_LEVEL_ERROR,
|
||||||
ER_TABLE_SCHEMA_MISMATCH,
|
ER_TABLE_SCHEMA_MISMATCH,
|
||||||
"Column %s precise type mismatch.",
|
"Column %s precise type mismatch,"
|
||||||
col_name);
|
" it's 0X%X in the table and 0X%X"
|
||||||
|
" in the tablespace meta file",
|
||||||
|
col_name, col->prtype, cfg_col->prtype);
|
||||||
err = DB_ERROR;
|
err = DB_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfg_col->mtype != col->mtype) {
|
if (cfg_col->mtype != col->mtype) {
|
||||||
ib_errf(thd,
|
ib_errf(thd,
|
||||||
IB_LOG_LEVEL_ERROR,
|
IB_LOG_LEVEL_ERROR,
|
||||||
ER_TABLE_SCHEMA_MISMATCH,
|
ER_TABLE_SCHEMA_MISMATCH,
|
||||||
"Column %s main type mismatch.",
|
"Column %s main type mismatch,"
|
||||||
col_name);
|
" it's 0X%X in the table and 0X%X"
|
||||||
|
" in the tablespace meta file",
|
||||||
|
col_name, col->mtype, cfg_col->mtype);
|
||||||
err = DB_ERROR;
|
err = DB_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfg_col->len != col->len) {
|
if (cfg_col->len != col->len) {
|
||||||
ib_errf(thd,
|
ib_errf(thd,
|
||||||
IB_LOG_LEVEL_ERROR,
|
IB_LOG_LEVEL_ERROR,
|
||||||
ER_TABLE_SCHEMA_MISMATCH,
|
ER_TABLE_SCHEMA_MISMATCH,
|
||||||
"Column %s length mismatch.",
|
"Column %s length mismatch,"
|
||||||
col_name);
|
" it's %u in the table and %u"
|
||||||
|
" in the tablespace meta file",
|
||||||
|
col_name, col->len, cfg_col->len);
|
||||||
err = DB_ERROR;
|
err = DB_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfg_col->mbminlen != col->mbminlen
|
if (cfg_col->mbminlen != col->mbminlen
|
||||||
|| cfg_col->mbmaxlen != col->mbmaxlen) {
|
|| cfg_col->mbmaxlen != col->mbmaxlen) {
|
||||||
ib_errf(thd,
|
ib_errf(thd,
|
||||||
IB_LOG_LEVEL_ERROR,
|
IB_LOG_LEVEL_ERROR,
|
||||||
ER_TABLE_SCHEMA_MISMATCH,
|
ER_TABLE_SCHEMA_MISMATCH,
|
||||||
"Column %s multi-byte len mismatch.",
|
"Column %s multi-byte len mismatch,"
|
||||||
col_name);
|
" it's %u-%u in the table and %u-%u"
|
||||||
|
" in the tablespace meta file",
|
||||||
|
col_name, col->mbminlen, col->mbmaxlen,
|
||||||
|
cfg_col->mbminlen, cfg_col->mbmaxlen);
|
||||||
err = DB_ERROR;
|
err = DB_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfg_col->ind != col->ind) {
|
if (cfg_col->ind != col->ind) {
|
||||||
|
ib_errf(thd,
|
||||||
|
IB_LOG_LEVEL_ERROR,
|
||||||
|
ER_TABLE_SCHEMA_MISMATCH,
|
||||||
|
"Column %s position mismatch,"
|
||||||
|
" it's %u in the table and %u"
|
||||||
|
" in the tablespace meta file",
|
||||||
|
col_name, col->ind, cfg_col->ind);
|
||||||
err = DB_ERROR;
|
err = DB_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfg_col->ord_part != col->ord_part) {
|
if (cfg_col->ord_part != col->ord_part) {
|
||||||
ib_errf(thd,
|
ib_errf(thd,
|
||||||
IB_LOG_LEVEL_ERROR,
|
IB_LOG_LEVEL_ERROR,
|
||||||
ER_TABLE_SCHEMA_MISMATCH,
|
ER_TABLE_SCHEMA_MISMATCH,
|
||||||
"Column %s ordering mismatch.",
|
"Column %s ordering mismatch,"
|
||||||
col_name);
|
" it's %u in the table and %u"
|
||||||
|
" in the tablespace meta file",
|
||||||
|
col_name, col->ord_part,
|
||||||
|
cfg_col->ord_part);
|
||||||
err = DB_ERROR;
|
err = DB_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfg_col->max_prefix != col->max_prefix) {
|
if (cfg_col->max_prefix != col->max_prefix) {
|
||||||
ib_errf(thd,
|
ib_errf(thd,
|
||||||
IB_LOG_LEVEL_ERROR,
|
IB_LOG_LEVEL_ERROR,
|
||||||
ER_TABLE_SCHEMA_MISMATCH,
|
ER_TABLE_SCHEMA_MISMATCH,
|
||||||
"Column %s max prefix mismatch.",
|
"Column %s max prefix mismatch"
|
||||||
col_name);
|
" it's %u in the table and %u"
|
||||||
|
" in the tablespace meta file",
|
||||||
|
col_name, col->max_prefix,
|
||||||
|
cfg_col->max_prefix);
|
||||||
err = DB_ERROR;
|
err = DB_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user