1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

don't allow TIMESTAMP(6) versioning and FK with CASCADE or SET NULL

This commit is contained in:
Sergei Golubchik
2018-02-23 13:42:34 +01:00
parent 794f71cbc4
commit 485325e7e3
10 changed files with 236 additions and 119 deletions

View File

@ -4469,6 +4469,19 @@ static bool vers_prepare_keys(THD *thd, HA_CREATE_INFO *create_info,
Key *key= NULL;
while ((key=key_it++))
{
if (key->type == Key::FOREIGN_KEY &&
create_info->vers_info.check_unit == VERS_TIMESTAMP)
{
Foreign_key *fk_key= (Foreign_key*) key;
enum enum_fk_option op;
if (fk_modifies_child(op=fk_key->update_opt) ||
fk_modifies_child(op=fk_key->delete_opt))
{
my_error(ER_VERS_NOT_SUPPORTED, MYF(0), fk_option_name(op)->str,
"TIMESTAMP(6) AS ROW START/END");
return true;
}
}
if (key->type != Key::PRIMARY && key->type != Key::UNIQUE)
continue;