Commit 17f8e0ec authored by Sergei Golubchik's avatar Sergei Golubchik

unify error messages a bit

parent 5282d0dc
...@@ -65,14 +65,24 @@ create or replace table t (i int) with system versioning; ...@@ -65,14 +65,24 @@ create or replace table t (i int) with system versioning;
delete history from t; delete history from t;
create or replace view v as select * from t; create or replace view v as select * from t;
delete history from v; delete history from v;
ERROR HY000: DELETE HISTORY from VIEW is prohibited ERROR 42S02: 'v' is a view
create or replace table t (i int); create or replace table t (i int);
delete history from t; delete history from t;
ERROR HY000: Table `t` is not system-versioned ERROR HY000: Table `t` is not system-versioned
create or replace view v as select * from t; create or replace view v as select * from t;
delete history from v; delete history from v;
ERROR HY000: DELETE HISTORY from VIEW is prohibited ERROR 42S02: 'v' is a view
prepare stmt from 'delete history from t'; prepare stmt from 'delete history from t';
ERROR HY000: Table `t` is not system-versioned ERROR HY000: Table `t` is not system-versioned
drop table t; drop table t;
drop view v; drop view v;
create or replace table t (i int);
create or replace view v as select * from t;
drop table v;
ERROR 42S02: 'test.v' is a view
lock table v write;
delete history from v before system_time now(6);
ERROR 42S02: 'v' is a view
unlock tables;
drop view v;
drop table t;
...@@ -60,17 +60,31 @@ select * from t for system_time all; ...@@ -60,17 +60,31 @@ select * from t for system_time all;
create or replace table t (i int) with system versioning; create or replace table t (i int) with system versioning;
delete history from t; delete history from t;
create or replace view v as select * from t; create or replace view v as select * from t;
--error ER_VERS_TRUNCATE_VIEW --error ER_IT_IS_A_VIEW
delete history from v; delete history from v;
create or replace table t (i int); create or replace table t (i int);
--error ER_VERS_NOT_VERSIONED --error ER_VERS_NOT_VERSIONED
delete history from t; delete history from t;
create or replace view v as select * from t; create or replace view v as select * from t;
--error ER_VERS_TRUNCATE_VIEW --error ER_IT_IS_A_VIEW
delete history from v; delete history from v;
--error ER_VERS_NOT_VERSIONED --error ER_VERS_NOT_VERSIONED
prepare stmt from 'delete history from t'; prepare stmt from 'delete history from t';
drop table t; drop table t;
drop view v; drop view v;
#
# MDEV-15402 Assertion `table' failed in mysql_delete on attempt to delete history from view
#
create or replace table t (i int);
create or replace view v as select * from t;
--error ER_IT_IS_A_VIEW
drop table v;
lock table v write;
--error ER_IT_IS_A_VIEW
delete history from v before system_time now(6);
unlock tables;
drop view v;
drop table t;
...@@ -7897,14 +7897,14 @@ ER_VERS_DUPLICATE_ROW_START_END ...@@ -7897,14 +7897,14 @@ ER_VERS_DUPLICATE_ROW_START_END
ER_VERS_ALREADY_VERSIONED ER_VERS_ALREADY_VERSIONED
eng "Table %`s is already system-versioned" eng "Table %`s is already system-versioned"
ER_VERS_TRUNCATE_VIEW ER_UNUSED_24
eng "DELETE HISTORY from VIEW is prohibited" eng "You should never see it"
ER_VERS_TEMPORARY ER_VERS_TEMPORARY
eng "System versioning prohibited for TEMPORARY tables" eng "System versioning prohibited for TEMPORARY tables"
ER_VERS_INPLACE_NOT_IMPLEMENTED ER_VERS_NOT_SUPPORTED
eng "Not implemented for system-versioned tables" eng "%s is not supported for %s system-versioned tables"
ER_INDEX_FILE_FULL ER_INDEX_FILE_FULL
eng "The index file for table '%-.192s' is full" eng "The index file for table '%-.192s' is full"
ER_UPDATED_COLUMN_ONLY_ONCE ER_UPDATED_COLUMN_ONLY_ONCE
......
...@@ -310,7 +310,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ...@@ -310,7 +310,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
{ {
if (table_list->is_view_or_derived()) if (table_list->is_view_or_derived())
{ {
my_error(ER_VERS_TRUNCATE_VIEW, MYF(0)); my_error(ER_IT_IS_A_VIEW, MYF(0), table_list->table_name.str);
DBUG_RETURN(true); DBUG_RETURN(true);
} }
...@@ -938,7 +938,7 @@ l ...@@ -938,7 +938,7 @@ l
{ {
if (table_list->is_view()) if (table_list->is_view())
{ {
my_error(ER_VERS_TRUNCATE_VIEW, MYF(0)); my_error(ER_IT_IS_A_VIEW, MYF(0), table_list->table_name.str);
DBUG_RETURN(true); DBUG_RETURN(true);
} }
if (select_lex->vers_setup_conds(thd, table_list, conds)) if (select_lex->vers_setup_conds(thd, table_list, conds))
......
...@@ -699,7 +699,7 @@ ha_innobase::check_if_supported_inplace_alter( ...@@ -699,7 +699,7 @@ ha_innobase::check_if_supported_inplace_alter(
if ((table->versioned(VERS_TIMESTAMP) || altered_table->versioned(VERS_TIMESTAMP)) if ((table->versioned(VERS_TIMESTAMP) || altered_table->versioned(VERS_TIMESTAMP))
&& innobase_need_rebuild(ha_alter_info, table)) { && innobase_need_rebuild(ha_alter_info, table)) {
ha_alter_info->unsupported_reason = ha_alter_info->unsupported_reason =
innobase_get_err_msg(ER_VERS_INPLACE_NOT_IMPLEMENTED); "Not implemented for system-versioned tables";
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED); DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
} }
...@@ -1239,7 +1239,7 @@ ha_innobase::check_if_supported_inplace_alter( ...@@ -1239,7 +1239,7 @@ ha_innobase::check_if_supported_inplace_alter(
if ((table->versioned(VERS_TRX_ID) || altered_table->versioned(VERS_TRX_ID)) if ((table->versioned(VERS_TRX_ID) || altered_table->versioned(VERS_TRX_ID))
&& innobase_need_rebuild(ha_alter_info, table)) { && innobase_need_rebuild(ha_alter_info, table)) {
ha_alter_info->unsupported_reason = ha_alter_info->unsupported_reason =
innobase_get_err_msg(ER_VERS_INPLACE_NOT_IMPLEMENTED); "Not implemented for system-versioned tables";
online = false; online = false;
} }
......
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