From d199591cf2aad9b056a13fe03d63031971155adb Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 11 May 2019 16:25:01 +0200 Subject: [PATCH] generalize the error message --- .../suite/federated/federatedx_versioning.result | 2 +- mysql-test/suite/versioning/r/alter.result | 10 +++++----- mysql-test/suite/versioning/r/create.result | 2 +- mysql-test/suite/versioning/r/debug.result | 2 +- mysql-test/suite/versioning/r/partition_innodb.result | 8 ++++---- mysql-test/suite/versioning/r/truncate.result | 6 +++--- mysql-test/suite/versioning/t/alter.test | 6 +++--- mysql-test/suite/versioning/t/create.test | 2 +- mysql-test/suite/versioning/t/debug.test | 2 +- mysql-test/suite/versioning/t/truncate.test | 6 +++--- sql/handler.cc | 2 +- sql/share/errmsg-utf8.txt | 10 ++++------ sql/sql_truncate.cc | 2 +- sql/sql_yacc.yy | 2 +- sql/sql_yacc_ora.yy | 2 +- 15 files changed, 31 insertions(+), 33 deletions(-) diff --git a/mysql-test/suite/federated/federatedx_versioning.result b/mysql-test/suite/federated/federatedx_versioning.result index a6572973ab1..8cb8e9191df 100644 --- a/mysql-test/suite/federated/federatedx_versioning.result +++ b/mysql-test/suite/federated/federatedx_versioning.result @@ -50,7 +50,7 @@ x # and not covered by tests # As of standard, TRUNCATE on versioned tables is forbidden truncate tf; -ERROR HY000: Got error 10000 'Error on remote system: 4160: Cannot truncate a versioned table' from FEDERATED +ERROR HY000: Got error 10000 'Error on remote system: 4137: System-versioned tables do not support TRUNCATE TABLE' from FEDERATED delete history from t1; select * from t1 for system_time all; x diff --git a/mysql-test/suite/versioning/r/alter.result b/mysql-test/suite/versioning/r/alter.result index c30aab6eb6d..c82a4d123c4 100644 --- a/mysql-test/suite/versioning/r/alter.result +++ b/mysql-test/suite/versioning/r/alter.result @@ -446,11 +446,11 @@ alter table t1 engine=myisam; # MDEV-14692 crash in MDL_context::upgrade_shared_lock() create or replace temporary table t (a int); alter table t change column if exists b c bigint unsigned generated always as row start; -ERROR HY000: TEMPORARY tables do not support system versioning +ERROR HY000: System-versioned tables do not support CREATE TEMPORARY TABLE alter table t change column if exists b c bigint unsigned generated always as row end; -ERROR HY000: TEMPORARY tables do not support system versioning +ERROR HY000: System-versioned tables do not support CREATE TEMPORARY TABLE alter table t add system versioning; -ERROR HY000: TEMPORARY tables do not support system versioning +ERROR HY000: System-versioned tables do not support CREATE TEMPORARY TABLE drop table t; # MDEV-14744 trx_id-based and transaction-based mixup in assertion create or replace table t (c text) engine=innodb with system versioning; @@ -526,9 +526,9 @@ ERROR HY000: Table `t` is already system-versioned # use mysql; create or replace table t (x int) with system versioning; -ERROR HY000: System versioning tables in the `mysql` database are not suported +ERROR HY000: System-versioned tables in the `mysql` database are not suported alter table db add system versioning; -ERROR HY000: System versioning tables in the `mysql` database are not suported +ERROR HY000: System-versioned tables in the `mysql` database are not suported use test; # MDEV-15956 Strange ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN upon ALTER on versioning column create or replace table t1 (i int, j int as (i), s timestamp(6) as row start, e timestamp(6) as row end, period for system_time(s,e)) with system versioning; diff --git a/mysql-test/suite/versioning/r/create.result b/mysql-test/suite/versioning/r/create.result index 18fe74d8171..7fa38bc893e 100644 --- a/mysql-test/suite/versioning/r/create.result +++ b/mysql-test/suite/versioning/r/create.result @@ -427,7 +427,7 @@ t3 CREATE TABLE `t3` ( ) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING ## Errors create or replace temporary table t (x28 int) with system versioning; -ERROR HY000: TEMPORARY tables do not support system versioning +ERROR HY000: System-versioned tables do not support CREATE TEMPORARY TABLE create or replace table t1 ( x29 int unsigned, Sys_start0 timestamp(6) as row start invisible, diff --git a/mysql-test/suite/versioning/r/debug.result b/mysql-test/suite/versioning/r/debug.result index 72bd1f18a68..c1c134692a2 100644 --- a/mysql-test/suite/versioning/r/debug.result +++ b/mysql-test/suite/versioning/r/debug.result @@ -5,7 +5,7 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create temporary table tt1 (a int) with system versioning; -ERROR HY000: TEMPORARY tables do not support system versioning +ERROR HY000: System-versioned tables do not support CREATE TEMPORARY TABLE set @old_dbug=@@global.debug_dbug; set global debug_dbug='+d,sysvers_force'; create table t2 (a int); diff --git a/mysql-test/suite/versioning/r/partition_innodb.result b/mysql-test/suite/versioning/r/partition_innodb.result index f5945304899..ad6075b7aa5 100644 --- a/mysql-test/suite/versioning/r/partition_innodb.result +++ b/mysql-test/suite/versioning/r/partition_innodb.result @@ -31,7 +31,7 @@ partition by key() ( partition p1, partition p2 ); -ERROR HY000: Transaction-precise system versioned tables do not support partitioning by ROW START or ROW END +ERROR HY000: Transaction-precise system-versioned tables do not support partitioning by ROW START or ROW END create or replace table t ( a int primary key, row_start bigint unsigned as row start invisible, @@ -42,7 +42,7 @@ partition by key(a, row_start) ( partition p1, partition p2 ); -ERROR HY000: Transaction-precise system versioned tables do not support partitioning by ROW START or ROW END +ERROR HY000: Transaction-precise system-versioned tables do not support partitioning by ROW START or ROW END create or replace table t ( a int primary key, row_start bigint unsigned as row start invisible, @@ -53,7 +53,7 @@ partition by hash(a + row_end * 2) ( partition p1, partition p2 ); -ERROR HY000: Transaction-precise system versioned tables do not support partitioning by ROW START or ROW END +ERROR HY000: Transaction-precise system-versioned tables do not support partitioning by ROW START or ROW END create or replace table t ( a int primary key, row_start bigint unsigned as row start invisible, @@ -63,7 +63,7 @@ period for system_time(row_start, row_end) partition by range columns (a, row_start) ( partition p1 values less than (100, 100) ); -ERROR HY000: Transaction-precise system versioned tables do not support partitioning by ROW START or ROW END +ERROR HY000: Transaction-precise system-versioned tables do not support partitioning by ROW START or ROW END # Test cleanup drop database test; create database test; diff --git a/mysql-test/suite/versioning/r/truncate.result b/mysql-test/suite/versioning/r/truncate.result index 706883bb04b..c7a90a2e726 100644 --- a/mysql-test/suite/versioning/r/truncate.result +++ b/mysql-test/suite/versioning/r/truncate.result @@ -113,7 +113,7 @@ create or replace table t2 (id int) with system versioning; flush tables t1, t2; truncate table t1; truncate table t2; -ERROR HY000: Cannot truncate a versioned table +ERROR HY000: System-versioned tables do not support TRUNCATE TABLE # fetch table shares describe t1; Field Type Null Key Default Extra @@ -123,12 +123,12 @@ Field Type Null Key Default Extra id int(11) YES NULL truncate table t1; truncate table t2; -ERROR HY000: Cannot truncate a versioned table +ERROR HY000: System-versioned tables do not support TRUNCATE TABLE # enter locked tables mode lock tables t1 WRITE, t2 WRITE; truncate t1; truncate t2; -ERROR HY000: Cannot truncate a versioned table +ERROR HY000: System-versioned tables do not support TRUNCATE TABLE unlock tables; drop database test; create database test; diff --git a/mysql-test/suite/versioning/t/alter.test b/mysql-test/suite/versioning/t/alter.test index 89379837fac..272c8ed0f74 100644 --- a/mysql-test/suite/versioning/t/alter.test +++ b/mysql-test/suite/versioning/t/alter.test @@ -368,11 +368,11 @@ alter table t1 engine=myisam; --echo # MDEV-14692 crash in MDL_context::upgrade_shared_lock() create or replace temporary table t (a int); ---error ER_VERS_TEMPORARY +--error ER_VERS_NOT_SUPPORTED alter table t change column if exists b c bigint unsigned generated always as row start; ---error ER_VERS_TEMPORARY +--error ER_VERS_NOT_SUPPORTED alter table t change column if exists b c bigint unsigned generated always as row end; ---error ER_VERS_TEMPORARY +--error ER_VERS_NOT_SUPPORTED alter table t add system versioning; drop table t; diff --git a/mysql-test/suite/versioning/t/create.test b/mysql-test/suite/versioning/t/create.test index 7a7eb556c67..8103330c722 100644 --- a/mysql-test/suite/versioning/t/create.test +++ b/mysql-test/suite/versioning/t/create.test @@ -310,7 +310,7 @@ show create table t3; --echo ## Errors ---error ER_VERS_TEMPORARY +--error ER_VERS_NOT_SUPPORTED create or replace temporary table t (x28 int) with system versioning; --error ER_VERS_DUPLICATE_ROW_START_END diff --git a/mysql-test/suite/versioning/t/debug.test b/mysql-test/suite/versioning/t/debug.test index c6d5bd60861..5069d7f6002 100644 --- a/mysql-test/suite/versioning/t/debug.test +++ b/mysql-test/suite/versioning/t/debug.test @@ -3,7 +3,7 @@ create table t1 (a int); show create table t1; ---error ER_VERS_TEMPORARY +--error ER_VERS_NOT_SUPPORTED create temporary table tt1 (a int) with system versioning; set @old_dbug=@@global.debug_dbug; diff --git a/mysql-test/suite/versioning/t/truncate.test b/mysql-test/suite/versioning/t/truncate.test index 360c73bb8ed..6b727e78e6b 100644 --- a/mysql-test/suite/versioning/t/truncate.test +++ b/mysql-test/suite/versioning/t/truncate.test @@ -125,7 +125,7 @@ create or replace table t2 (id int) with system versioning; flush tables t1, t2; truncate table t1; ---error ER_TRUNCATE_ILLEGAL_VERS +--error ER_VERS_NOT_SUPPORTED truncate table t2; -- echo # fetch table shares @@ -133,14 +133,14 @@ describe t1; describe t2; truncate table t1; ---error ER_TRUNCATE_ILLEGAL_VERS +--error ER_VERS_NOT_SUPPORTED truncate table t2; --echo # enter locked tables mode lock tables t1 WRITE, t2 WRITE; truncate t1; ---error ER_TRUNCATE_ILLEGAL_VERS +--error ER_VERS_NOT_SUPPORTED truncate t2; unlock tables; diff --git a/sql/handler.cc b/sql/handler.cc index 12a05aba90d..edd6e40b8ec 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -7355,7 +7355,7 @@ bool Vers_parse_info::fix_alter_info(THD *thd, Alter_info *alter_info, if (DBUG_EVALUATE_IF("sysvers_force", 0, share->tmp_table)) { - my_error(ER_VERS_TEMPORARY, MYF(0)); + my_error(ER_VERS_NOT_SUPPORTED, MYF(0), "CREATE TEMPORARY TABLE"); return true; } diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 94737d48e64..45e6eabbf5a 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -7869,7 +7869,7 @@ ER_DROP_VERSIONING_SYSTEM_TIME_PARTITION eng "Can not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIME" ER_VERS_DB_NOT_SUPPORTED - eng "System versioning tables in the %`s database are not suported" + eng "System-versioned tables in the %`s database are not suported" ER_VERS_TRT_IS_DISABLED eng "Transaction registry is disabled" @@ -7883,11 +7883,11 @@ ER_VERS_ALREADY_VERSIONED ER_UNUSED_24 eng "You should never see it" -ER_VERS_TEMPORARY - eng "TEMPORARY tables do not support system versioning" +ER_VERS_NOT_SUPPORTED + eng "System-versioned tables do not support %s" ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED - eng "Transaction-precise system versioned tables do not support partitioning by ROW START or ROW END" + eng "Transaction-precise system-versioned tables do not support partitioning by ROW START or ROW END" ER_INDEX_FILE_FULL eng "The index file for table '%-.192s' is full" ER_UPDATED_COLUMN_ONLY_ONCE @@ -7931,5 +7931,3 @@ ER_PERIOD_CONSTRAINT_DROP eng "Can't DROP CONSTRAINT `%s`. Use DROP PERIOD `%s` for this" ER_TOO_LONG_KEYPART 42000 S1009 eng "Specified key part was too long; max key part length is %u bytes" -ER_TRUNCATE_ILLEGAL_VERS - eng "Cannot truncate a versioned table" diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index c0de635579a..c0dee66c317 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -340,7 +340,7 @@ bool Sql_cmd_truncate_table::lock_table(THD *thd, TABLE_LIST *table_ref, if (versioned) { - my_error(ER_TRUNCATE_ILLEGAL_VERS, MYF(0)); + my_error(ER_VERS_NOT_SUPPORTED, MYF(0), "TRUNCATE TABLE"); DBUG_RETURN(TRUE); } diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 23faa57ad61..70eb7803dba 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -6355,7 +6355,7 @@ versioning_option: { if (DBUG_EVALUATE_IF("sysvers_force", 0, 1)) { - my_error(ER_VERS_TEMPORARY, MYF(0)); + my_error(ER_VERS_NOT_SUPPORTED, MYF(0), "CREATE TEMPORARY TABLE"); MYSQL_YYABORT; } } diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy index 88b40b915d9..7401e788c8e 100644 --- a/sql/sql_yacc_ora.yy +++ b/sql/sql_yacc_ora.yy @@ -6380,7 +6380,7 @@ versioning_option: { if (DBUG_EVALUATE_IF("sysvers_force", 0, 1)) { - my_error(ER_VERS_TEMPORARY, MYF(0)); + my_error(ER_VERS_NOT_SUPPORTED, MYF(0), "CREATE TEMPORARY TABLE"); MYSQL_YYABORT; } }