Commit 39db1165 authored by Aleksey Midenkov's avatar Aleksey Midenkov

MDEV-18862 Unfortunate error message upon attempt to drop system versioning

Fix error code.
parent 65d48b4a
......@@ -622,9 +622,9 @@ set sql_mode= default;
set system_versioning_alter_history= keep;
create or replace table t1 (x int) with system versioning;
alter table t1 drop column `row_start`, drop column `row_end`, drop period for system_time, drop system versioning;
ERROR HY000: No 'PERIOD FOR SYSTEM_TIME' in system-versioned `t1`
ERROR 42000: Can't DROP PERIOD FOR SYSTEM_TIME on `t1`; check that it exists
alter table t1 drop period for system_time;
ERROR HY000: No 'PERIOD FOR SYSTEM_TIME' in system-versioned `t1`
ERROR 42000: Can't DROP PERIOD FOR SYSTEM_TIME on `t1`; check that it exists
alter table t1 drop column `row_start`, drop column `row_end`, drop system versioning;
ERROR 42000: Can't DROP COLUMN `row_start`; check that it exists
alter table t1 drop column `row_end`;
......
......@@ -519,9 +519,9 @@ set sql_mode= default;
--echo #
set system_versioning_alter_history= keep;
create or replace table t1 (x int) with system versioning;
--error ER_VERS_NO_PERIOD
--error ER_CANT_DROP_FIELD_OR_KEY
alter table t1 drop column `row_start`, drop column `row_end`, drop period for system_time, drop system versioning;
--error ER_VERS_NO_PERIOD
--error ER_CANT_DROP_FIELD_OR_KEY
alter table t1 drop period for system_time;
--error ER_CANT_DROP_FIELD_OR_KEY
alter table t1 drop column `row_start`, drop column `row_end`, drop system versioning;
......
......@@ -7898,5 +7898,3 @@ ER_KEY_DOESNT_SUPPORT
eng "%s index %`s does not support this operation"
ER_ALTER_OPERATION_TABLE_OPTIONS_NEED_REBUILD
eng "Changing table options requires the table to be rebuilt"
ER_VERS_NO_PERIOD
eng "No 'PERIOD FOR SYSTEM_TIME' in system-versioned %`s"
......@@ -8078,7 +8078,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
}
else if (alter_info->flags & ALTER_DROP_PERIOD && vers_system_invisible)
{
my_error(ER_VERS_NO_PERIOD, MYF(0), table->s->table_name.str);
my_error(ER_CANT_DROP_FIELD_OR_KEY, MYF(0), "PERIOD FOR SYSTEM_TIME on", table->s->table_name.str);
goto err;
}
alter_info->flags &= ~(ALTER_DROP_PERIOD | ALTER_ADD_PERIOD);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment