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

Tests: inserting an explicit value into a vers column

must behave as any other generated column: an error in the strict mode,
a warning otherwise.
parent b85efdc3
......@@ -308,8 +308,11 @@ create or replace table t1 (x int) with system versioning engine innodb;
insert into t1 values (1), (2);
insert into t1 (row_start) select row_end from t1;
ERROR HY000: The value specified for generated column 'row_start' in table 't1' ignored
set sql_mode='';
insert into t1 (row_start, row_end) values (DEFAULT, 1);
ERROR HY000: The value specified for generated column 'row_end' in table 't1' ignored
Warnings:
Warning 1906 The value specified for generated column 'row_end' in table 't1' ignored
set sql_mode=default;
select @@sql_mode into @saved_mode;
set sql_mode= '';
insert into t1 (x, row_start, row_end) values (3, 4, 5);
......@@ -322,6 +325,7 @@ select * from t1;
x
1
2
NULL
3
NULL
# MDEV-14792 INSERT without column list into table with explicit versioning columns produces bad data
......
......@@ -210,8 +210,9 @@ create or replace table t1 (x int) with system versioning engine innodb;
insert into t1 values (1), (2);
--error ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN
insert into t1 (row_start) select row_end from t1;
--error ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN
set sql_mode='';
insert into t1 (row_start, row_end) values (DEFAULT, 1);
set sql_mode=default;
select @@sql_mode into @saved_mode;
set sql_mode= '';
insert into t1 (x, row_start, row_end) values (3, 4, 5);
......
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