diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-12-13 18:01:49 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-12-13 18:01:49 +0200 |
commit | 25b91c3f13affc1b58169240894b206ff34b1db3 (patch) | |
tree | 4042ba02c9777eabc030c80f376cd6e25114ac6d /mysql-test/suite/gcol | |
parent | dbcbee10176dde410867a3762385a9e5ee63e1d3 (diff) | |
parent | a8a5c8a1b8ac566241d43a85de90c11f5d1568d9 (diff) | |
download | mariadb-git-25b91c3f13affc1b58169240894b206ff34b1db3.tar.gz |
Merge 10.6 into 10.7
Diffstat (limited to 'mysql-test/suite/gcol')
6 files changed, 57 insertions, 4 deletions
diff --git a/mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc b/mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc index 9435551ce6f..879e2fe857d 100644 --- a/mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc +++ b/mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc @@ -247,3 +247,7 @@ create table t1 (a int); alter table t1 add column r blob generated always as (match(a) against ('' in boolean mode)) virtual; drop table t1; + +--echo # +--echo # End of 10.3 tests +--echo # diff --git a/mysql-test/suite/gcol/inc/gcol_column_def_options.inc b/mysql-test/suite/gcol/inc/gcol_column_def_options.inc index 646dc1abc7b..d4db5b5de76 100644 --- a/mysql-test/suite/gcol/inc/gcol_column_def_options.inc +++ b/mysql-test/suite/gcol/inc/gcol_column_def_options.inc @@ -49,18 +49,18 @@ alter table t1 add column (h int generated always as (a+1) virtual, i int as(5) drop table t1; --echo # DEFAULT ---error 1064 +--error ER_PARSE_ERROR create table t1 (a int, b int generated always as (a+1) virtual default 0); create table t1 (a int); ---error 1064 +--error ER_PARSE_ERROR alter table t1 add column b int generated always as (a+1) virtual default 0; drop table t1; --echo # AUTO_INCREMENT ---error 1064 +--error ER_PARSE_ERROR create table t1 (a int, b int generated always as (a+1) virtual AUTO_INCREMENT); create table t1 (a int); ---error 1064 +--error ER_PARSE_ERROR alter table t1 add column b int generated always as (a+1) virtual AUTO_INCREMENT; drop table t1; @@ -203,6 +203,13 @@ create table t1 (a int, b int generated always as(-b) virtual, c int generated a create table t1 (a int, b int generated always as(-c) virtual, c int generated always as (b + 1) virtual); --error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED create table t1 (pk int auto_increment primary key, col_int_nokey int generated always as (pk + col_int_key) stored, col_int_key int); +--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +create table t1 (pk int auto_increment primary key, col_int_nokey int generated always as (pk + col_int_key) unique, col_int_key int); +create table t1 (pk int auto_increment primary key, col_int_nokey int generated always as (pk + col_int_key), col_int_key int); +show create table t1; +insert t1 (col_int_key) values (10),(20),(30); +select * from t1; +drop table t1; --echo # Bug#20339347: FAIL TO USE CREATE ....SELECT STATEMENT TO CREATE A NEW TABLE create table t1 (a int, b int generated always as(-a) virtual, c int generated always as (b + 1) stored); diff --git a/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result b/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result index fa8f2660aef..b9fe877b0f2 100644 --- a/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result @@ -170,6 +170,9 @@ alter table t1 add column r blob generated always as (match(a) against ('' in boolean mode)) virtual; ERROR HY000: Function or expression 'match ... against()' cannot be used in the GENERATED ALWAYS AS clause of `r` drop table t1; +# +# End of 10.3 tests +# DROP VIEW IF EXISTS v1,v2; DROP TABLE IF EXISTS t1,t2,t3; DROP PROCEDURE IF EXISTS p1; diff --git a/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result b/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result index b777bb485de..23fdea42488 100644 --- a/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result @@ -172,6 +172,9 @@ alter table t1 add column r blob generated always as (match(a) against ('' in boolean mode)) virtual; ERROR HY000: Function or expression 'match ... against()' cannot be used in the GENERATED ALWAYS AS clause of `r` drop table t1; +# +# End of 10.3 tests +# DROP VIEW IF EXISTS v1,v2; DROP TABLE IF EXISTS t1,t2,t3; DROP PROCEDURE IF EXISTS p1; diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result index 9e8211e7160..8c1925c942a 100644 --- a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result @@ -264,6 +264,24 @@ create table t1 (a int, b int generated always as(-c) virtual, c int generated a ERROR 01000: Expression for field `b` is referring to uninitialized field `c` create table t1 (pk int auto_increment primary key, col_int_nokey int generated always as (pk + col_int_key) stored, col_int_key int); ERROR HY000: Function or expression 'AUTO_INCREMENT' cannot be used in the GENERATED ALWAYS AS clause of `pk` +create table t1 (pk int auto_increment primary key, col_int_nokey int generated always as (pk + col_int_key) unique, col_int_key int); +ERROR HY000: Function or expression 'AUTO_INCREMENT' cannot be used in the GENERATED ALWAYS AS clause of `pk` +create table t1 (pk int auto_increment primary key, col_int_nokey int generated always as (pk + col_int_key), col_int_key int); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `pk` int(11) NOT NULL AUTO_INCREMENT, + `col_int_nokey` int(11) GENERATED ALWAYS AS (`pk` + `col_int_key`) VIRTUAL, + `col_int_key` int(11) DEFAULT NULL, + PRIMARY KEY (`pk`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +insert t1 (col_int_key) values (10),(20),(30); +select * from t1; +pk col_int_nokey col_int_key +1 11 10 +2 22 20 +3 33 30 +drop table t1; # Bug#20339347: FAIL TO USE CREATE ....SELECT STATEMENT TO CREATE A NEW TABLE create table t1 (a int, b int generated always as(-a) virtual, c int generated always as (b + 1) stored); insert into t1(a) values(1),(2); diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result index f5f9c44b1e3..734e05bbcd3 100644 --- a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result @@ -264,6 +264,24 @@ create table t1 (a int, b int generated always as(-c) virtual, c int generated a ERROR 01000: Expression for field `b` is referring to uninitialized field `c` create table t1 (pk int auto_increment primary key, col_int_nokey int generated always as (pk + col_int_key) stored, col_int_key int); ERROR HY000: Function or expression 'AUTO_INCREMENT' cannot be used in the GENERATED ALWAYS AS clause of `pk` +create table t1 (pk int auto_increment primary key, col_int_nokey int generated always as (pk + col_int_key) unique, col_int_key int); +ERROR HY000: Function or expression 'AUTO_INCREMENT' cannot be used in the GENERATED ALWAYS AS clause of `pk` +create table t1 (pk int auto_increment primary key, col_int_nokey int generated always as (pk + col_int_key), col_int_key int); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `pk` int(11) NOT NULL AUTO_INCREMENT, + `col_int_nokey` int(11) GENERATED ALWAYS AS (`pk` + `col_int_key`) VIRTUAL, + `col_int_key` int(11) DEFAULT NULL, + PRIMARY KEY (`pk`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +insert t1 (col_int_key) values (10),(20),(30); +select * from t1; +pk col_int_nokey col_int_key +1 11 10 +2 22 20 +3 33 30 +drop table t1; # Bug#20339347: FAIL TO USE CREATE ....SELECT STATEMENT TO CREATE A NEW TABLE create table t1 (a int, b int generated always as(-a) virtual, c int generated always as (b + 1) stored); insert into t1(a) values(1),(2); |