Commit ca4dbcff authored by Sergei Golubchik's avatar Sergei Golubchik Committed by Aleksey Midenkov

Tests: system columns *not* being auto-renamed (create, alter)

it's correct, they preserve their documented names
parent 35b679b9
...@@ -450,5 +450,20 @@ alter table t drop column a; ...@@ -450,5 +450,20 @@ alter table t drop column a;
ERROR HY000: Table `t` must have at least one versioned column ERROR HY000: Table `t` must have at least one versioned column
alter table t drop column a, drop column a; alter table t drop column a, drop column a;
ERROR 42000: Can't DROP COLUMN `a`; check that it exists ERROR 42000: Can't DROP COLUMN `a`; check that it exists
create or replace table t1 (sys_trx_start int);
alter table t1 with system versioning;
ERROR 42S21: Duplicate column name 'sys_trx_start'
create or replace table t1 (sys_trx_end int);
alter table t1 with system versioning;
ERROR 42S21: Duplicate column name 'sys_trx_end'
create or replace table t1 (a int, sys_trx_start int) with system versioning;
ERROR 42S21: Duplicate column name 'sys_trx_start'
create or replace table t1 (a int) with system versioning;
set statement system_versioning_alter_history=keep for
alter table t1 add column sys_trx_start int;
ERROR 42S21: Duplicate column name 'sys_trx_start'
set statement system_versioning_alter_history=keep for
alter table t1 add column sys_trx_start timestamp(6);
ERROR 42S21: Duplicate column name 'sys_trx_start'
drop database test; drop database test;
create database test; create database test;
...@@ -341,12 +341,6 @@ t3 CREATE TABLE `t3` ( ...@@ -341,12 +341,6 @@ t3 CREATE TABLE `t3` (
`x27` int(11) DEFAULT NULL `x27` int(11) DEFAULT NULL
) ENGINE=NON_DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING ) ENGINE=NON_DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
## Errors ## Errors
create or replace table t (sys_trx_start int);
alter table t with system versioning;
ERROR 42S21: Duplicate column name 'sys_trx_start'
create or replace table t (sys_trx_end int);
alter table t with system versioning;
ERROR 42S21: Duplicate column name 'sys_trx_end'
create or replace temporary table t (x28 int) with system versioning; create or replace temporary table t (x28 int) with system versioning;
ERROR HY000: System versioning prohibited for TEMPORARY tables ERROR HY000: System versioning prohibited for TEMPORARY tables
create or replace table t1 ( create or replace table t1 (
......
...@@ -383,6 +383,26 @@ alter table t drop column a; ...@@ -383,6 +383,26 @@ alter table t drop column a;
--error ER_CANT_DROP_FIELD_OR_KEY --error ER_CANT_DROP_FIELD_OR_KEY
alter table t drop column a, drop column a; alter table t drop column a, drop column a;
create or replace table t1 (sys_trx_start int);
--error ER_DUP_FIELDNAME
alter table t1 with system versioning;
create or replace table t1 (sys_trx_end int);
--error ER_DUP_FIELDNAME
alter table t1 with system versioning;
--error ER_DUP_FIELDNAME
create or replace table t1 (a int, sys_trx_start int) with system versioning;
create or replace table t1 (a int) with system versioning;
--error ER_DUP_FIELDNAME
set statement system_versioning_alter_history=keep for
alter table t1 add column sys_trx_start int;
--error ER_DUP_FIELDNAME
set statement system_versioning_alter_history=keep for
alter table t1 add column sys_trx_start timestamp(6);
drop database test; drop database test;
create database test; create database test;
...@@ -306,13 +306,6 @@ as select t2.b, t1.x27, t1.sys_trx_start, t1.sys_trx_end from t2 inner join t1 o ...@@ -306,13 +306,6 @@ as select t2.b, t1.x27, t1.sys_trx_start, t1.sys_trx_end from t2 inner join t1 o
show create table t3; show create table t3;
--echo ## Errors --echo ## Errors
create or replace table t (sys_trx_start int);
--error ER_DUP_FIELDNAME
alter table t with system versioning;
create or replace table t (sys_trx_end int);
--error ER_DUP_FIELDNAME
alter table t with system versioning;
--error ER_VERS_TEMPORARY --error ER_VERS_TEMPORARY
create or replace temporary table t (x28 int) with system versioning; create or replace temporary table t (x28 int) with system versioning;
......
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