From c5d0c38efce836c3c87b520880e2b119dc41f4f7 Mon Sep 17 00:00:00 2001 From: Aleksey Midenkov Date: Tue, 19 Dec 2017 22:05:25 +0300 Subject: [PATCH] MDEV-14676 Redundancy in error codes ER_VERS_NOT_VERSIONED vs ER_VERSIONING_REQUIRED --- mysql-test/suite/versioning/r/insert.result | 2 +- .../suite/versioning/r/optimized.result | 34 +++++++++---------- .../suite/versioning/r/partition.result | 12 +++---- mysql-test/suite/versioning/r/select.result | 2 +- .../suite/versioning/r/select_sp.result | 2 +- mysql-test/suite/versioning/r/truncate.result | 4 +-- mysql-test/suite/versioning/r/trx_id.result | 2 +- mysql-test/suite/versioning/t/select.test | 2 +- mysql-test/suite/versioning/t/select_sp.test | 2 +- mysql-test/suite/versioning/t/truncate.test | 4 +-- sql/share/errmsg-utf8.txt | 4 +-- sql/sql_select.cc | 4 +-- 12 files changed, 36 insertions(+), 38 deletions(-) diff --git a/mysql-test/suite/versioning/r/insert.result b/mysql-test/suite/versioning/r/insert.result index 06237f6904e..4cefb02dc0d 100644 --- a/mysql-test/suite/versioning/r/insert.result +++ b/mysql-test/suite/versioning/r/insert.result @@ -290,7 +290,7 @@ insert into t1(x) values (1); ERROR HY000: Temporal operation requires `mysql.transaction_registry` (@@system_versioning_transaction_registry). set global system_versioning_transaction_registry= on; Warnings: -Warning 4145 Transaction-based system versioning is EXPERIMENTAL and is subject to change in future. +Warning 4144 Transaction-based system versioning is EXPERIMENTAL and is subject to change in future. create or replace table t1 ( x int, y int as (x) virtual, diff --git a/mysql-test/suite/versioning/r/optimized.result b/mysql-test/suite/versioning/r/optimized.result index c86a2de0153..9bb6231d76d 100644 --- a/mysql-test/suite/versioning/r/optimized.result +++ b/mysql-test/suite/versioning/r/optimized.result @@ -17,59 +17,59 @@ a b b+0 1 NULL NULL 3 NULL NULL Warnings: -Warning 4112 Attempt to read non-temporal field `b` in historical query -Warning 4112 Attempt to read non-temporal field `b` in historical query +Warning 4111 Attempt to read non-temporal field `b` in historical query +Warning 4111 Attempt to read non-temporal field `b` in historical query select * from t for system_time as of timestamp now(6); a b 1 NULL 3 NULL Warnings: -Warning 4112 Attempt to read non-temporal field `b` in historical query +Warning 4111 Attempt to read non-temporal field `b` in historical query select count(*) from t for system_time as of timestamp now(6) group by b; count(*) 2 Warnings: -Warning 4112 Attempt to read non-temporal field `b` in historical query +Warning 4111 Attempt to read non-temporal field `b` in historical query select * from t for system_time as of timestamp now(6) order by b asc; a b 1 NULL 3 NULL Warnings: -Warning 4112 Attempt to read non-temporal field `b` in historical query -Warning 4112 Attempt to read non-temporal field `b` in historical query +Warning 4111 Attempt to read non-temporal field `b` in historical query +Warning 4111 Attempt to read non-temporal field `b` in historical query select * from t for system_time as of timestamp now(6) order by b desc; a b 1 NULL 3 NULL Warnings: -Warning 4112 Attempt to read non-temporal field `b` in historical query -Warning 4112 Attempt to read non-temporal field `b` in historical query +Warning 4111 Attempt to read non-temporal field `b` in historical query +Warning 4111 Attempt to read non-temporal field `b` in historical query select * from t for system_time as of timestamp now(6) group by a having a=2; a b Warnings: -Warning 4112 Attempt to read non-temporal field `b` in historical query +Warning 4111 Attempt to read non-temporal field `b` in historical query select * from t for system_time as of timestamp now(6) group by b having b=2; a b Warnings: -Warning 4112 Attempt to read non-temporal field `b` in historical query +Warning 4111 Attempt to read non-temporal field `b` in historical query select a from t for system_time as of timestamp now(6) where b=2; a Warnings: -Warning 4112 Attempt to read non-temporal field `b` in historical query +Warning 4111 Attempt to read non-temporal field `b` in historical query select a from t for system_time as of timestamp now(6) where b=NULL; a Warnings: -Warning 4112 Attempt to read non-temporal field `b` in historical query +Warning 4111 Attempt to read non-temporal field `b` in historical query select a from t for system_time as of timestamp now(6) where b is NULL; a 1 3 Warnings: -Warning 4112 Attempt to read non-temporal field `b` in historical query +Warning 4111 Attempt to read non-temporal field `b` in historical query select count(*), b from t for system_time as of timestamp now(6) group by b having b=NULL; count(*) b Warnings: -Warning 4112 Attempt to read non-temporal field `b` in historical query +Warning 4111 Attempt to read non-temporal field `b` in historical query select a, b from t; a b 1 2 @@ -84,12 +84,12 @@ a b 1 NULL 3 NULL Warnings: -Warning 4112 Attempt to read non-temporal field `b` in historical query +Warning 4111 Attempt to read non-temporal field `b` in historical query select * from t for system_time as of timestamp now(6) where b is NULL; a b 1 NULL 3 NULL Warnings: -Warning 4112 Attempt to read non-temporal field `b` in historical query -Warning 4112 Attempt to read non-temporal field `b` in historical query +Warning 4111 Attempt to read non-temporal field `b` in historical query +Warning 4111 Attempt to read non-temporal field `b` in historical query drop table t; diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result index 9fddd74cba7..985fa015a2d 100644 --- a/mysql-test/suite/versioning/r/partition.result +++ b/mysql-test/suite/versioning/r/partition.result @@ -85,7 +85,7 @@ ERROR HY000: Wrong partitions for `t1`: must have at least one HISTORY and exact alter table t1 add partition ( partition p1 history); Warnings: -Warning 4115 Maybe missing parameters: no rotation condition for multiple HISTORY partitions. +Warning 4114 Maybe missing parameters: no rotation condition for multiple HISTORY partitions. show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -229,7 +229,7 @@ x ### warn about partition switching delete from t1; Warnings: -Note 4116 Versioned table `test`.`t1`: switching from partition `p0` to `p1` +Note 4115 Versioned table `test`.`t1`: switching from partition `p0` to `p1` select * from t1 partition (p0); x 1 @@ -241,7 +241,7 @@ insert into t1 values (4), (5); ### warn about full partition delete from t1; Warnings: -Warning 4114 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions +Warning 4113 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions select * from t1 partition (p1) order by x; x 3 @@ -276,7 +276,7 @@ x insert into t1 values (4); delete from t1; Warnings: -Note 4116 Versioned table `test`.`t1`: switching from partition `p0` to `p1` +Note 4115 Versioned table `test`.`t1`: switching from partition `p0` to `p1` select * from t1 partition (p1); x 4 @@ -302,8 +302,8 @@ x ### warn about partition switching and about full partition delete from t1; Warnings: -Note 4116 Versioned table `test`.`t1`: switching from partition `p0` to `p1` -Warning 4114 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions +Note 4115 Versioned table `test`.`t1`: switching from partition `p0` to `p1` +Warning 4113 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions select * from t1 partition (p0sp0); x 1 diff --git a/mysql-test/suite/versioning/r/select.result b/mysql-test/suite/versioning/r/select.result index 13ccec1f6bb..664e98fb58f 100644 --- a/mysql-test/suite/versioning/r/select.result +++ b/mysql-test/suite/versioning/r/select.result @@ -202,7 +202,7 @@ A create or replace table t1 (x int); insert into t1 values (1); select * from t1 for system_time all; -ERROR HY000: System versioning required: t1 +ERROR HY000: Table `t1` is not system-versioned create or replace table t1 (x int) with system versioning; insert into t1 values (1); select * from t1 for system_time all for update; diff --git a/mysql-test/suite/versioning/r/select_sp.result b/mysql-test/suite/versioning/r/select_sp.result index 2d37ffbb8f1..35ae4256418 100644 --- a/mysql-test/suite/versioning/r/select_sp.result +++ b/mysql-test/suite/versioning/r/select_sp.result @@ -217,7 +217,7 @@ A create or replace table t1 (x int); insert into t1 values (1); select * from t1 for system_time all; -ERROR HY000: System versioning required: t1 +ERROR HY000: Table `t1` is not system-versioned create or replace table t1 (x int) with system versioning; insert into t1 values (1); select * from t1 for system_time all for update; diff --git a/mysql-test/suite/versioning/r/truncate.result b/mysql-test/suite/versioning/r/truncate.result index 36ac4fe5ed3..7c368b99a15 100644 --- a/mysql-test/suite/versioning/r/truncate.result +++ b/mysql-test/suite/versioning/r/truncate.result @@ -1,6 +1,6 @@ create table t (a int); delete history from t before system_time now(); -ERROR HY000: System versioning required: t +ERROR HY000: Table `t` is not system-versioned create or replace table t (a int) with system versioning; insert into t values (1); update t set a=2; @@ -53,7 +53,7 @@ delete history from v before system_time now(); ERROR HY000: TRUNCATE table_name TO doesn't work with VIEWs create or replace table t (i int); delete history from t before system_time now(); -ERROR HY000: System versioning required: t +ERROR HY000: Table `t` is not system-versioned create or replace view v as select * from t; delete history from v before system_time now(); ERROR HY000: TRUNCATE table_name TO doesn't work with VIEWs diff --git a/mysql-test/suite/versioning/r/trx_id.result b/mysql-test/suite/versioning/r/trx_id.result index 929e49f8b53..dc1380a77b0 100644 --- a/mysql-test/suite/versioning/r/trx_id.result +++ b/mysql-test/suite/versioning/r/trx_id.result @@ -10,7 +10,7 @@ period for system_time (sys_trx_start, sys_trx_end) ERROR HY000: Temporal operation requires `mysql.transaction_registry` (@@system_versioning_transaction_registry). set global system_versioning_transaction_registry= 1; Warnings: -Warning 4145 Transaction-based system versioning is EXPERIMENTAL and is subject to change in future. +Warning 4144 Transaction-based system versioning is EXPERIMENTAL and is subject to change in future. create or replace table t1 ( x int, sys_trx_start bigint(20) unsigned as row start invisible, diff --git a/mysql-test/suite/versioning/t/select.test b/mysql-test/suite/versioning/t/select.test index c0dbcbd972a..9a4f37cb097 100644 --- a/mysql-test/suite/versioning/t/select.test +++ b/mysql-test/suite/versioning/t/select.test @@ -117,7 +117,7 @@ select * from t1; create or replace table t1 (x int); insert into t1 values (1); ---error ER_VERSIONING_REQUIRED +--error ER_VERS_NOT_VERSIONED select * from t1 for system_time all; create or replace table t1 (x int) with system versioning; diff --git a/mysql-test/suite/versioning/t/select_sp.test b/mysql-test/suite/versioning/t/select_sp.test index 6e85508104c..7551d5e2efb 100644 --- a/mysql-test/suite/versioning/t/select_sp.test +++ b/mysql-test/suite/versioning/t/select_sp.test @@ -115,7 +115,7 @@ select * from t1; create or replace table t1 (x int); insert into t1 values (1); ---error ER_VERSIONING_REQUIRED +--error ER_VERS_NOT_VERSIONED select * from t1 for system_time all; create or replace table t1 (x int) with system versioning; diff --git a/mysql-test/suite/versioning/t/truncate.test b/mysql-test/suite/versioning/t/truncate.test index 72da15b56d9..9623ee0d310 100644 --- a/mysql-test/suite/versioning/t/truncate.test +++ b/mysql-test/suite/versioning/t/truncate.test @@ -1,7 +1,7 @@ --source suite/versioning/engines.inc create table t (a int); ---error ER_VERSIONING_REQUIRED +--error ER_VERS_NOT_VERSIONED delete history from t before system_time now(); # TRUNCATE is not DELETE and trigger must not be called. @@ -47,7 +47,7 @@ create or replace view v as select * from t; delete history from v before system_time now(); create or replace table t (i int); ---error ER_VERSIONING_REQUIRED +--error ER_VERS_NOT_VERSIONED delete history from t before system_time now(); create or replace view v as select * from t; --error ER_VERS_TRUNCATE_TO_VIEW diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 44a681cc044..f76efb95185 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -7813,10 +7813,8 @@ ER_INVALID_VALUE_TO_LIMIT ER_INVISIBLE_NOT_NULL_WITHOUT_DEFAULT eng "Invisible column %`s must have a default value" -# MariaDB error numbers related to System Versioning -ER_VERSIONING_REQUIRED - eng "System versioning required: %s" +# MariaDB error numbers related to System Versioning ER_UPDATE_INFO_WITH_SYSTEM_VERSIONING eng "Rows matched: %ld Changed: %ld Inserted: %ld Warnings: %ld" diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 651c7fc838a..1bd0f2ab922 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -741,7 +741,7 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables, COND **where_expr versioned_tables++; else if (table->vers_conditions.user_defined()) { - my_error(ER_VERSIONING_REQUIRED, MYF(0), table->alias); + my_error(ER_VERS_NOT_VERSIONED, MYF(0), table->alias); DBUG_RETURN(-1); } } @@ -840,7 +840,7 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables, COND **where_expr char buf[NAME_LEN*2 + sizeof(PART_VERS_ERR_MSG)]; my_snprintf(buf, sizeof(buf), PART_VERS_ERR_MSG, table->alias, table->partition_names->head()->c_ptr()); - my_error(ER_VERSIONING_REQUIRED, MYF(0), buf); + my_error(ER_VERS_NOT_VERSIONED, MYF(0), buf); DBUG_RETURN(-1); } else