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

Cannot DROP VERSIONING without dropping all visible AS ROW fields

This commit is contained in:
Sergei Golubchik
2018-02-08 23:03:35 +01:00
parent f3a49e7020
commit c847089e6e
3 changed files with 12 additions and 0 deletions

View File

@ -64,6 +64,8 @@ t CREATE TABLE `t` (
`trx_end` timestamp(6) GENERATED ALWAYS AS ROW END INVISIBLE,
PERIOD FOR SYSTEM_TIME (`trx_start`, `trx_end`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
alter table t drop system versioning;
ERROR HY000: System versioning field `trx_start` exists
alter table t drop column trx_start, drop column trx_end;
alter table t drop system versioning;
show create table t;

View File

@ -53,6 +53,9 @@ alter table t
add system versioning;
show create table t;
--error ER_VERS_SYS_FIELD_EXISTS
alter table t drop system versioning;
alter table t drop column trx_start, drop column trx_end;
alter table t drop system versioning;
show create table t;

View File

@ -8009,6 +8009,13 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
def_it.remove();
}
}
else if (alter_info->flags & Alter_info::ALTER_DROP_SYSTEM_VERSIONING &&
field->flags & VERS_SYSTEM_FIELD &&
field->invisible < INVISIBLE_SYSTEM)
{
my_error(ER_VERS_SYS_FIELD_EXISTS, MYF(0), field->field_name.str);
goto err;
}
else
{
/*