1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge branch '10.5' into 10.6

This commit is contained in:
Oleksandr Byelkin
2023-08-02 20:20:50 +02:00
42 changed files with 639 additions and 404 deletions

View File

@@ -1,24 +1,28 @@
--source include/have_innodb.inc
create table t1(f1 int primary key) engine=innodb;
--echo # Create statement with FK on base column of stored column
--error ER_CANT_CREATE_TABLE
create table t1(f1 int, f2 int as(f1) stored,
foreign key(f1) references t2(f1) on delete cascade)engine=innodb;
--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
create table t2(f1 int not null, f2 int as (f1) stored,
foreign key(f1) references t1(f1) on update cascade)engine=innodb;
--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
create table t2(f1 int not null, f2 int as (f1) virtual, f3 int as (f2) stored,
foreign key(f1) references t1(f1) on update cascade)engine=innodb;
--echo # adding new stored column during alter table copy operation.
create table t1(f1 int primary key) engine=innodb;
create table t2(f1 int not null, f2 int as (f1) virtual,
foreign key(f1) references t1(f1) on update cascade)engine=innodb;
# MySQL 5.7 would refuse this
#--error ER_ERROR_ON_RENAME
--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
alter table t2 add column f3 int as (f1) stored, add column f4 int as (f1) virtual;
show create table t2;
drop table t2;
--echo # adding foreign key constraint for base columns during alter copy.
create table t2(f1 int not null, f2 int as (f1) stored) engine=innodb;
# MySQL 5.7 would refuse this
--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
alter table t2 add foreign key(f1) references t1(f1) on update cascade, algorithm=copy;
show create table t2;
drop table t2;
@@ -26,14 +30,14 @@ drop table t2;
--echo # adding foreign key constraint for base columns during online alter.
create table t2(f1 int not null, f2 int as (f1) stored) engine=innodb;
set foreign_key_checks = 0;
--error 138
--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
alter table t2 add foreign key(f1) references t1(f1) on update cascade, algorithm=inplace;
drop table t2;
--echo # adding stored column via online alter.
create table t2(f1 int not null,
foreign key(f1) references t1(f1) on update cascade)engine=innodb;
--error ER_ALTER_OPERATION_NOT_SUPPORTED
--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
alter table t2 add column f2 int as (f1) stored, algorithm=inplace;
drop table t2, t1;