1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-16102 Wrong ER_DUP_ENTRY upon ADD UNIQUE KEY on versioned table

* ignore CHECK constraint for historical rows;
* FOREIGN KEY test case.

TODO:
MDEV-16301 IB: use real table name for error messages on ALTER

Closes tempesta-tech/mariadb#491
Closes #748
This commit is contained in:
Aleksey Midenkov
2018-05-08 14:14:36 +03:00
committed by Sergei Golubchik
parent b5184c7efb
commit 7c0779da7c
7 changed files with 67 additions and 14 deletions

View File

@ -9130,8 +9130,7 @@ bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db,
DBUG_RETURN(true);
}
}
if (alter_info->data_modifying() && !thd->slave_thread &&
thd->variables.vers_alter_history == VERS_ALTER_HISTORY_ERROR)
if (alter_info->vers_prohibited(thd))
{
my_error(ER_VERS_ALTER_NOT_ALLOWED, MYF(0),
table_list->db.str, table_list->table_name.str);