Commit c5d0c38e authored by Aleksey Midenkov's avatar Aleksey Midenkov

MDEV-14676 Redundancy in error codes

ER_VERS_NOT_VERSIONED vs ER_VERSIONING_REQUIRED
parent fc21529f
...@@ -290,7 +290,7 @@ insert into t1(x) values (1); ...@@ -290,7 +290,7 @@ insert into t1(x) values (1);
ERROR HY000: Temporal operation requires `mysql.transaction_registry` (@@system_versioning_transaction_registry). ERROR HY000: Temporal operation requires `mysql.transaction_registry` (@@system_versioning_transaction_registry).
set global system_versioning_transaction_registry= on; set global system_versioning_transaction_registry= on;
Warnings: 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 ( create or replace table t1 (
x int, x int,
y int as (x) virtual, y int as (x) virtual,
......
...@@ -17,59 +17,59 @@ a b b+0 ...@@ -17,59 +17,59 @@ a b b+0
1 NULL NULL 1 NULL NULL
3 NULL NULL 3 NULL NULL
Warnings: 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
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); select * from t for system_time as of timestamp now(6);
a b a b
1 NULL 1 NULL
3 NULL 3 NULL
Warnings: 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; select count(*) from t for system_time as of timestamp now(6) group by b;
count(*) count(*)
2 2
Warnings: 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; select * from t for system_time as of timestamp now(6) order by b asc;
a b a b
1 NULL 1 NULL
3 NULL 3 NULL
Warnings: 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
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 desc; select * from t for system_time as of timestamp now(6) order by b desc;
a b a b
1 NULL 1 NULL
3 NULL 3 NULL
Warnings: 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
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 a having a=2; select * from t for system_time as of timestamp now(6) group by a having a=2;
a b a b
Warnings: 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; select * from t for system_time as of timestamp now(6) group by b having b=2;
a b a b
Warnings: 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; select a from t for system_time as of timestamp now(6) where b=2;
a a
Warnings: 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; select a from t for system_time as of timestamp now(6) where b=NULL;
a a
Warnings: 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; select a from t for system_time as of timestamp now(6) where b is NULL;
a a
1 1
3 3
Warnings: 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; select count(*), b from t for system_time as of timestamp now(6) group by b having b=NULL;
count(*) b count(*) b
Warnings: 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; select a, b from t;
a b a b
1 2 1 2
...@@ -84,12 +84,12 @@ a b ...@@ -84,12 +84,12 @@ a b
1 NULL 1 NULL
3 NULL 3 NULL
Warnings: 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; select * from t for system_time as of timestamp now(6) where b is NULL;
a b a b
1 NULL 1 NULL
3 NULL 3 NULL
Warnings: 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
Warning 4112 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; drop table t;
...@@ -85,7 +85,7 @@ ERROR HY000: Wrong partitions for `t1`: must have at least one HISTORY and exact ...@@ -85,7 +85,7 @@ ERROR HY000: Wrong partitions for `t1`: must have at least one HISTORY and exact
alter table t1 add partition ( alter table t1 add partition (
partition p1 history); partition p1 history);
Warnings: 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; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
...@@ -229,7 +229,7 @@ x ...@@ -229,7 +229,7 @@ x
### warn about partition switching ### warn about partition switching
delete from t1; delete from t1;
Warnings: 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); select * from t1 partition (p0);
x x
1 1
...@@ -241,7 +241,7 @@ insert into t1 values (4), (5); ...@@ -241,7 +241,7 @@ insert into t1 values (4), (5);
### warn about full partition ### warn about full partition
delete from t1; delete from t1;
Warnings: 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; select * from t1 partition (p1) order by x;
x x
3 3
...@@ -276,7 +276,7 @@ x ...@@ -276,7 +276,7 @@ x
insert into t1 values (4); insert into t1 values (4);
delete from t1; delete from t1;
Warnings: 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); select * from t1 partition (p1);
x x
4 4
...@@ -302,8 +302,8 @@ x ...@@ -302,8 +302,8 @@ x
### warn about partition switching and about full partition ### warn about partition switching and about full partition
delete from t1; delete from t1;
Warnings: 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`
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 (p0sp0); select * from t1 partition (p0sp0);
x x
1 1
......
...@@ -202,7 +202,7 @@ A ...@@ -202,7 +202,7 @@ A
create or replace table t1 (x int); create or replace table t1 (x int);
insert into t1 values (1); insert into t1 values (1);
select * from t1 for system_time all; 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; create or replace table t1 (x int) with system versioning;
insert into t1 values (1); insert into t1 values (1);
select * from t1 for system_time all for update; select * from t1 for system_time all for update;
......
...@@ -217,7 +217,7 @@ A ...@@ -217,7 +217,7 @@ A
create or replace table t1 (x int); create or replace table t1 (x int);
insert into t1 values (1); insert into t1 values (1);
select * from t1 for system_time all; 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; create or replace table t1 (x int) with system versioning;
insert into t1 values (1); insert into t1 values (1);
select * from t1 for system_time all for update; select * from t1 for system_time all for update;
......
create table t (a int); create table t (a int);
delete history from t before system_time now(); 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; create or replace table t (a int) with system versioning;
insert into t values (1); insert into t values (1);
update t set a=2; update t set a=2;
...@@ -53,7 +53,7 @@ delete history from v before system_time now(); ...@@ -53,7 +53,7 @@ delete history from v before system_time now();
ERROR HY000: TRUNCATE table_name TO doesn't work with VIEWs ERROR HY000: TRUNCATE table_name TO doesn't work with VIEWs
create or replace table t (i int); create or replace table t (i int);
delete history from t before system_time now(); 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; create or replace view v as select * from t;
delete history from v before system_time now(); delete history from v before system_time now();
ERROR HY000: TRUNCATE table_name TO doesn't work with VIEWs ERROR HY000: TRUNCATE table_name TO doesn't work with VIEWs
......
...@@ -10,7 +10,7 @@ period for system_time (sys_trx_start, sys_trx_end) ...@@ -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). ERROR HY000: Temporal operation requires `mysql.transaction_registry` (@@system_versioning_transaction_registry).
set global system_versioning_transaction_registry= 1; set global system_versioning_transaction_registry= 1;
Warnings: 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 ( create or replace table t1 (
x int, x int,
sys_trx_start bigint(20) unsigned as row start invisible, sys_trx_start bigint(20) unsigned as row start invisible,
......
...@@ -117,7 +117,7 @@ select * from t1; ...@@ -117,7 +117,7 @@ select * from t1;
create or replace table t1 (x int); create or replace table t1 (x int);
insert into t1 values (1); insert into t1 values (1);
--error ER_VERSIONING_REQUIRED --error ER_VERS_NOT_VERSIONED
select * from t1 for system_time all; select * from t1 for system_time all;
create or replace table t1 (x int) with system versioning; create or replace table t1 (x int) with system versioning;
......
...@@ -115,7 +115,7 @@ select * from t1; ...@@ -115,7 +115,7 @@ select * from t1;
create or replace table t1 (x int); create or replace table t1 (x int);
insert into t1 values (1); insert into t1 values (1);
--error ER_VERSIONING_REQUIRED --error ER_VERS_NOT_VERSIONED
select * from t1 for system_time all; select * from t1 for system_time all;
create or replace table t1 (x int) with system versioning; create or replace table t1 (x int) with system versioning;
......
--source suite/versioning/engines.inc --source suite/versioning/engines.inc
create table t (a int); create table t (a int);
--error ER_VERSIONING_REQUIRED --error ER_VERS_NOT_VERSIONED
delete history from t before system_time now(); delete history from t before system_time now();
# TRUNCATE is not DELETE and trigger must not be called. # TRUNCATE is not DELETE and trigger must not be called.
...@@ -47,7 +47,7 @@ create or replace view v as select * from t; ...@@ -47,7 +47,7 @@ create or replace view v as select * from t;
delete history from v before system_time now(); delete history from v before system_time now();
create or replace table t (i int); create or replace table t (i int);
--error ER_VERSIONING_REQUIRED --error ER_VERS_NOT_VERSIONED
delete history from t before system_time now(); delete history from t before system_time now();
create or replace view v as select * from t; create or replace view v as select * from t;
--error ER_VERS_TRUNCATE_TO_VIEW --error ER_VERS_TRUNCATE_TO_VIEW
......
...@@ -7813,10 +7813,8 @@ ER_INVALID_VALUE_TO_LIMIT ...@@ -7813,10 +7813,8 @@ ER_INVALID_VALUE_TO_LIMIT
ER_INVISIBLE_NOT_NULL_WITHOUT_DEFAULT ER_INVISIBLE_NOT_NULL_WITHOUT_DEFAULT
eng "Invisible column %`s must have a default value" eng "Invisible column %`s must have a default value"
# MariaDB error numbers related to System Versioning
ER_VERSIONING_REQUIRED # MariaDB error numbers related to System Versioning
eng "System versioning required: %s"
ER_UPDATE_INFO_WITH_SYSTEM_VERSIONING ER_UPDATE_INFO_WITH_SYSTEM_VERSIONING
eng "Rows matched: %ld Changed: %ld Inserted: %ld Warnings: %ld" eng "Rows matched: %ld Changed: %ld Inserted: %ld Warnings: %ld"
......
...@@ -741,7 +741,7 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables, COND **where_expr ...@@ -741,7 +741,7 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables, COND **where_expr
versioned_tables++; versioned_tables++;
else if (table->vers_conditions.user_defined()) 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); DBUG_RETURN(-1);
} }
} }
...@@ -840,7 +840,7 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables, COND **where_expr ...@@ -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)]; char buf[NAME_LEN*2 + sizeof(PART_VERS_ERR_MSG)];
my_snprintf(buf, sizeof(buf), PART_VERS_ERR_MSG, table->alias, my_snprintf(buf, sizeof(buf), PART_VERS_ERR_MSG, table->alias,
table->partition_names->head()->c_ptr()); 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); DBUG_RETURN(-1);
} }
else else
......
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