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);
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,
......
......@@ -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;
......@@ -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
......
......@@ -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;
......
......@@ -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;
......
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
......
......@@ -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,
......
......@@ -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;
......
......@@ -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;
......
--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
......
......@@ -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"
......
......@@ -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
......
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