mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge branch '10.9' into 10.10
This commit is contained in:
@@ -10,3 +10,73 @@ select * from t2;
|
||||
id
|
||||
drop table t2;
|
||||
drop table t1;
|
||||
#
|
||||
# End of 10.2 tests
|
||||
#
|
||||
#
|
||||
# MDEV-18114 Foreign Key Constraint actions don't affect Virtual Column
|
||||
#
|
||||
create table t1 (id int primary key);
|
||||
create or replace table t2 (id int, id2 int as (id) virtual, key(id2), foreign key (id) references t1 (id) on update restrict);
|
||||
create or replace table t2 (id int, id2 int as (id) virtual, key(id2), foreign key (id) references t1 (id) on update no action);
|
||||
create or replace table t2 (id int, id2 int as (id) virtual, key(id2), foreign key (id) references t1 (id) on delete cascade);
|
||||
create or replace table t2 (id int, id2 int as (id) virtual, key(id2), foreign key (id) references t1 (id) on update cascade);
|
||||
create or replace table t2 (id int, id2 int as (id) virtual, key(id2), foreign key (id) references t1 (id) on delete set null);
|
||||
create or replace table t2 (id int, id2 int as (id) virtual, key(id2), foreign key (id) references t1 (id) on update set null);
|
||||
create or replace table t2 (id int, id2 int as (id) stored, foreign key (id) references t1 (id) on update restrict);
|
||||
create or replace table t2 (id int, id2 int as (id) stored, foreign key (id) references t1 (id) on update no action);
|
||||
create or replace table t2 (id int, id2 int as (id) stored, foreign key (id) references t1 (id) on delete cascade);
|
||||
create or replace table t2 (id int, id2 int as (id) stored, foreign key (id) references t1 (id) on update cascade);
|
||||
ERROR HY000: Function or expression 'id' cannot be used in the GENERATED ALWAYS AS clause of `id2`
|
||||
create or replace table t2 (id int, id2 int as (id) stored, foreign key (id) references t1 (id) on delete set null);
|
||||
ERROR HY000: Function or expression 'id' cannot be used in the GENERATED ALWAYS AS clause of `id2`
|
||||
create or replace table t2 (id int, id2 int as (id) stored, foreign key (id) references t1 (id) on update set null);
|
||||
ERROR HY000: Function or expression 'id' cannot be used in the GENERATED ALWAYS AS clause of `id2`
|
||||
create or replace table t2 (id int, id2 int as (id) virtual, id3 int as (id2) stored, foreign key (id) references t1 (id) on update restrict);
|
||||
create or replace table t2 (id int, id2 int as (id) virtual, id3 int as (id2) stored, foreign key (id) references t1 (id) on update no action);
|
||||
create or replace table t2 (id int, id2 int as (id) virtual, id3 int as (id2) stored, foreign key (id) references t1 (id) on delete cascade);
|
||||
create or replace table t2 (id int, id2 int as (id) virtual, id3 int as (id2) stored, foreign key (id) references t1 (id) on update cascade);
|
||||
ERROR HY000: Function or expression 'id2' cannot be used in the GENERATED ALWAYS AS clause of `id3`
|
||||
create or replace table t2 (id int, id2 int as (id) virtual, id3 int as (id2) stored, foreign key (id) references t1 (id) on delete set null);
|
||||
ERROR HY000: Function or expression 'id2' cannot be used in the GENERATED ALWAYS AS clause of `id3`
|
||||
create or replace table t2 (id int, id2 int as (id) virtual, id3 int as (id2) stored, foreign key (id) references t1 (id) on update set null);
|
||||
ERROR HY000: Function or expression 'id2' cannot be used in the GENERATED ALWAYS AS clause of `id3`
|
||||
create or replace table t2 (id int, id2 int default (id), foreign key (id) references t1 (id) on update restrict);
|
||||
create or replace table t2 (id int, id2 int default (id), foreign key (id) references t1 (id) on update no action);
|
||||
create or replace table t2 (id int, id2 int default (id), foreign key (id) references t1 (id) on delete cascade);
|
||||
create or replace table t2 (id int, id2 int default (id), foreign key (id) references t1 (id) on update cascade);
|
||||
create or replace table t2 (id int, id2 int default (id), foreign key (id) references t1 (id) on delete set null);
|
||||
create or replace table t2 (id int, id2 int default (id), foreign key (id) references t1 (id) on update set null);
|
||||
create or replace table t2 (id int, id2 int check (id), foreign key (id) references t1 (id) on update restrict);
|
||||
create or replace table t2 (id int, id2 int check (id), foreign key (id) references t1 (id) on update no action);
|
||||
create or replace table t2 (id int, id2 int check (id), foreign key (id) references t1 (id) on delete cascade);
|
||||
create or replace table t2 (id int, id2 int check (id), foreign key (id) references t1 (id) on update cascade);
|
||||
ERROR HY000: Function or expression 'id' cannot be used in the CHECK clause of `id2`
|
||||
create or replace table t2 (id int, id2 int check (id), foreign key (id) references t1 (id) on delete set null);
|
||||
ERROR HY000: Function or expression 'id' cannot be used in the CHECK clause of `id2`
|
||||
create or replace table t2 (id int, id2 int check (id), foreign key (id) references t1 (id) on update set null);
|
||||
ERROR HY000: Function or expression 'id' cannot be used in the CHECK clause of `id2`
|
||||
create or replace table t2 (id int, id2 int, check (id), foreign key (id) references t1 (id) on update restrict);
|
||||
create or replace table t2 (id int, id2 int, check (id), foreign key (id) references t1 (id) on update no action);
|
||||
create or replace table t2 (id int, id2 int, check (id), foreign key (id) references t1 (id) on delete cascade);
|
||||
create or replace table t2 (id int, id2 int, check (id), foreign key (id) references t1 (id) on update cascade);
|
||||
ERROR HY000: Function or expression 'id' cannot be used in the CHECK clause of `CONSTRAINT_1`
|
||||
create or replace table t2 (id int, id2 int, check (id), foreign key (id) references t1 (id) on delete set null);
|
||||
ERROR HY000: Function or expression 'id' cannot be used in the CHECK clause of `CONSTRAINT_1`
|
||||
create or replace table t2 (id int, id2 int, check (id), foreign key (id) references t1 (id) on update set null);
|
||||
ERROR HY000: Function or expression 'id' cannot be used in the CHECK clause of `CONSTRAINT_1`
|
||||
create or replace table t2 (id int, id2 int as (id) virtual, check (id2), foreign key (id) references t1 (id) on update restrict);
|
||||
create or replace table t2 (id int, id2 int as (id) virtual, check (id2), foreign key (id) references t1 (id) on update no action);
|
||||
create or replace table t2 (id int, id2 int as (id) virtual, check (id2), foreign key (id) references t1 (id) on delete cascade);
|
||||
create or replace table t2 (id int, id2 int as (id) virtual, check (id2), foreign key (id) references t1 (id) on update cascade);
|
||||
ERROR HY000: Function or expression 'id2' cannot be used in the CHECK clause of `CONSTRAINT_1`
|
||||
create or replace table t2 (id int, id2 int as (id) virtual, check (id2), foreign key (id) references t1 (id) on delete set null);
|
||||
ERROR HY000: Function or expression 'id2' cannot be used in the CHECK clause of `CONSTRAINT_1`
|
||||
create or replace table t2 (id int, id2 int as (id) virtual, check (id2), foreign key (id) references t1 (id) on update set null);
|
||||
ERROR HY000: Function or expression 'id2' cannot be used in the CHECK clause of `CONSTRAINT_1`
|
||||
drop table if exists t2, t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 'test.t2'
|
||||
#
|
||||
# End of 10.5 tests
|
||||
#
|
||||
|
@@ -54,22 +54,22 @@ set session sql_mode=@OLD_SQL_MODE;
|
||||
#
|
||||
create table t2 (x int);
|
||||
create table t1 (x int, y int generated always as (t2.x));
|
||||
ERROR 42S22: Unknown column '`t2`.`x`' in 'GENERATED ALWAYS'
|
||||
ERROR HY000: Function or expression 't2.x' cannot be used in the GENERATED ALWAYS AS clause of `y`
|
||||
create table t1 (x int, y int check (y > t2.x));
|
||||
ERROR 42S22: Unknown column '`t2`.`x`' in 'CHECK'
|
||||
ERROR HY000: Function or expression 't2.x' cannot be used in the CHECK clause of `y`
|
||||
create table t1 (x int, y int default t2.x);
|
||||
ERROR 42S22: Unknown column '`t2`.`x`' in 'DEFAULT'
|
||||
ERROR HY000: Function or expression 't2.x' cannot be used in the DEFAULT clause of `y`
|
||||
create table t1 (x int, check (t2.x > 0));
|
||||
ERROR 42S22: Unknown column '`t2`.`x`' in 'CHECK'
|
||||
ERROR HY000: Function or expression 't2.x' cannot be used in the CHECK clause of `CONSTRAINT_1`
|
||||
create table t1 (x int);
|
||||
alter table t1 add column y int generated always as (t2.x);
|
||||
ERROR 42S22: Unknown column '`t2`.`x`' in 'GENERATED ALWAYS'
|
||||
ERROR HY000: Function or expression 't2.x' cannot be used in the GENERATED ALWAYS AS clause of `y`
|
||||
alter table t1 add column y int check (z > t2.x);
|
||||
ERROR 42S22: Unknown column '`t2`.`x`' in 'CHECK'
|
||||
ERROR HY000: Function or expression 't2.x' cannot be used in the CHECK clause of `y`
|
||||
alter table t1 add column y int default t2.x;
|
||||
ERROR 42S22: Unknown column '`t2`.`x`' in 'DEFAULT'
|
||||
ERROR HY000: Function or expression 't2.x' cannot be used in the DEFAULT clause of `y`
|
||||
alter table t1 add constraint check (t2.x > 0);
|
||||
ERROR 42S22: Unknown column '`t2`.`x`' in 'CHECK'
|
||||
ERROR HY000: Function or expression 't2.x' cannot be used in the CHECK clause of `CONSTRAINT_1`
|
||||
create or replace table t1 (x int, y int generated always as (t1.x));
|
||||
create or replace table t1 (x int, y int check (y > t1.x));
|
||||
create or replace table t1 (x int, y int default t1.x);
|
||||
@@ -80,13 +80,13 @@ create or replace table t1 (x int, y int default test.t1.x);
|
||||
create or replace table t1 (x int, check (test.t1.x > 0));
|
||||
drop tables t1, t2;
|
||||
create table t1 (x int, y int generated always as (test2.t1.x));
|
||||
ERROR 42S22: Unknown column '`test2`.`t1`.`x`' in 'GENERATED ALWAYS'
|
||||
ERROR HY000: Function or expression 'test2.t1.x' cannot be used in the GENERATED ALWAYS AS clause of `y`
|
||||
create table t1 (x int, y int check (y > test2.t1.x));
|
||||
ERROR 42S22: Unknown column '`test2`.`t1`.`x`' in 'CHECK'
|
||||
ERROR HY000: Function or expression 'test2.t1.x' cannot be used in the CHECK clause of `y`
|
||||
create table t1 (x int, y int default test2.t1.x);
|
||||
ERROR 42S22: Unknown column '`test2`.`t1`.`x`' in 'DEFAULT'
|
||||
ERROR HY000: Function or expression 'test2.t1.x' cannot be used in the DEFAULT clause of `y`
|
||||
create table t1 (x int, check (test2.t1.x > 0));
|
||||
ERROR 42S22: Unknown column '`test2`.`t1`.`x`' in 'CHECK'
|
||||
ERROR HY000: Function or expression 'test2.t1.x' cannot be used in the CHECK clause of `CONSTRAINT_1`
|
||||
#
|
||||
# MDEV-25672 table alias from previous statement interferes later commands
|
||||
#
|
||||
@@ -197,3 +197,40 @@ Warnings:
|
||||
Warning 1292 Truncated incorrect DECIMAL value: 'x'
|
||||
Warning 1292 Truncated incorrect DECIMAL value: 'test'
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-31319 Assertion const_item_cache == true failed in Item_func::fix_fields
|
||||
#
|
||||
create table t (f1 int, f2 int, fv int generated always as (case user() when 'foo' or 'bar' then f1 else f2 end) virtual);
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'foo'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'bar'
|
||||
select * from t;
|
||||
f1 f2 fv
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'foo'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'bar'
|
||||
create table tmp as select * from information_schema.tables where table_name = 't';
|
||||
select * from t;
|
||||
f1 f2 fv
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'foo'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'bar'
|
||||
drop table t, tmp;
|
||||
#
|
||||
# MDEV-29357 Assertion (fixed) in Item_func_dayname on INSERT
|
||||
#
|
||||
set sql_mode='';
|
||||
create table t (c1 blob ,c2 int,c3 char(10) as (dayname (c2)));
|
||||
create trigger tr before insert on t for each row set new.c2=0;
|
||||
insert into t values (0, 0, 0);
|
||||
Warnings:
|
||||
Warning 1906 The value specified for generated column 'c3' in table 't' has been ignored
|
||||
Warning 1292 Incorrect datetime value: '0' for column `test`.`t`.`c2` at row 1
|
||||
Warning 1292 Incorrect datetime value: '0' for column `test`.`t`.`c2` at row 1
|
||||
insert into t values (1, 1, 1);
|
||||
Warnings:
|
||||
Warning 1906 The value specified for generated column 'c3' in table 't' has been ignored
|
||||
Warning 1292 Incorrect datetime value: '1' for column `test`.`t`.`c2` at row 1
|
||||
Warning 1292 Incorrect datetime value: '0' for column `test`.`t`.`c2` at row 1
|
||||
drop trigger tr;
|
||||
drop table t;
|
||||
|
Reference in New Issue
Block a user