summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2022-03-29 13:44:14 +0300
committerAleksey Midenkov <midenok@gmail.com>2022-03-29 13:44:14 +0300
commit58cd2a8dedd78b25ada0996dee2bd3e0520c17b6 (patch)
tree0053d73f9e800719cbb29ebac8f0ca4bdf074a93 /sql/table.cc
parent020e7d89ebdcded3355c82cec93e0abef2898258 (diff)
downloadmariadb-git-58cd2a8dedd78b25ada0996dee2bd3e0520c17b6.tar.gz
MDEV-19525 remove ER_VERS_FIELD_WRONG_TYPE from init_from_binary_frm_image()
Throw ER_NOT_FORM_FILE if this is wrong FRM data (warning with ER_VERS_FIELD_WRONG_TYPE is still printed for deeper knowledge of what was happened). Keep ER_VERS_FIELD_WRONG_TYPE for creating partitioned table with trx-versioning. Tested by MDEV-15951 in trx_id.test
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 2ab947d69cd..7d022ba8ca3 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -2082,6 +2082,9 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
if (flags & VERS_SYSTEM_FIELD)
{
+ if (DBUG_EVALUATE_IF("error_vers_wrong_type", 1, 0))
+ field_type= MYSQL_TYPE_BLOB;
+
switch (field_type)
{
case MYSQL_TYPE_TIMESTAMP2:
@@ -2094,9 +2097,13 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
}
/* Fallthrough */
default:
- my_error(ER_VERS_FIELD_WRONG_TYPE, MYF(0), fieldnames.type_names[i],
- versioned == VERS_TIMESTAMP ? "TIMESTAMP(6)" : "BIGINT(20) UNSIGNED",
- table_name.str);
+ my_error(ER_VERS_FIELD_WRONG_TYPE,
+ (field_type == MYSQL_TYPE_LONGLONG ?
+ MYF(0) : MYF(ME_WARNING)),
+ fieldnames.type_names[i],
+ (versioned == VERS_TIMESTAMP ?
+ "TIMESTAMP(6)" : "BIGINT(20) UNSIGNED"),
+ table_name.str);
goto err;
}
}