Skip to content
Permalink
Browse files

MDEV-18862 Unfortunate error message upon attempt to drop system vers…

…ioning

Fix error code.
  • Loading branch information...
midenok committed Aug 13, 2019
1 parent 65d48b4 commit 39db116562f7e5bdd4b8c5dbbdc21a06c7ae09ad
@@ -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;
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);

0 comments on commit 39db116

Please sign in to comment.
You can’t perform that action at this time.