diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-01-24 16:14:12 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-01-24 16:14:12 +0200 |
commit | 947b6b849d907dc0793f076aec7e553869db744f (patch) | |
tree | 50e7d87866ed50b8510336ce33d515ed32386754 /mysql-test/suite/gcol | |
parent | 55be043c13d45581a0cecbae85d1f7de2708d891 (diff) | |
parent | fab531a150ec588f87e8a636d2ba1ecbfffdb08e (diff) | |
download | mariadb-git-947b6b849d907dc0793f076aec7e553869db744f.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/suite/gcol')
4 files changed, 57 insertions, 0 deletions
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_fk_restart.result b/mysql-test/suite/gcol/r/innodb_virtual_fk_restart.result index 25faeaf4e84..1d4766eab19 100644 --- a/mysql-test/suite/gcol/r/innodb_virtual_fk_restart.result +++ b/mysql-test/suite/gcol/r/innodb_virtual_fk_restart.result @@ -7,9 +7,18 @@ CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY) engine=innodb; CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT NOT NULL, fld3 INT AS (fld2) VIRTUAL, KEY(fld1), FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE) engine=innodb; +CREATE TABLE u1(a INT, KEY(a)) ENGINE=InnoDB; +CREATE TABLE u2(b INT, vb INT GENERATED ALWAYS AS(b) VIRTUAL, KEY(vb), +FOREIGN KEY(b) REFERENCES u1(a)ON DELETE CASCADE)ENGINE=InnoDB; +INSERT INTO u1 SET a=1; +INSERT INTO u2 SET b=1; INSERT INTO t1(fld1) VALUES(1); INSERT INTO t2(fld1, fld2) VALUES(1, 2); UPDATE t1 SET fld1= 2; +DELETE FROM u1; +SELECT * FROM u2; +b vb +DROP TABLE u2,u1; SELECT fld3, fld1 FROM t2; fld3 fld1 2 2 diff --git a/mysql-test/suite/gcol/r/innodb_virtual_index.result b/mysql-test/suite/gcol/r/innodb_virtual_index.result index bde9f086eac..6913ec698b4 100644 --- a/mysql-test/suite/gcol/r/innodb_virtual_index.result +++ b/mysql-test/suite/gcol/r/innodb_virtual_index.result @@ -239,3 +239,23 @@ KEY (a(1)) INSERT INTO t1(b) VALUES(REPEAT('b',1000)); DELETE FROM t1; DROP TABLE t1; +# +# Bug #22990029 GCOLS: INCORRECT BEHAVIOR +# AFTER DATA INSERTED WITH IGNORE KEYWORD +# +CREATE TABLE t1(a INT PRIMARY KEY, b INT, vb DATE AS(b) VIRTUAL, KEY(vb)) +ENGINE=InnoDB; +INSERT IGNORE INTO t1 (a,b) VALUES(1,20190132); +Warnings: +Warning 1265 Data truncated for column 'vb' at row 1 +BEGIN; +DELETE FROM t1; +INSERT INTO t1 (a,b) VALUES(1,20190123); +ERROR 22007: Incorrect date value: '20190132' for column `test`.`t1`.`vb` at row 1 +SELECT * FROM t1; +a b vb +ROLLBACK; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; diff --git a/mysql-test/suite/gcol/t/innodb_virtual_fk_restart.test b/mysql-test/suite/gcol/t/innodb_virtual_fk_restart.test index 61d330036ea..45d1c1295a5 100644 --- a/mysql-test/suite/gcol/t/innodb_virtual_fk_restart.test +++ b/mysql-test/suite/gcol/t/innodb_virtual_fk_restart.test @@ -11,10 +11,19 @@ CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY) engine=innodb; CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT NOT NULL, fld3 INT AS (fld2) VIRTUAL, KEY(fld1), FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE) engine=innodb; +CREATE TABLE u1(a INT, KEY(a)) ENGINE=InnoDB; +CREATE TABLE u2(b INT, vb INT GENERATED ALWAYS AS(b) VIRTUAL, KEY(vb), + FOREIGN KEY(b) REFERENCES u1(a)ON DELETE CASCADE)ENGINE=InnoDB; + +INSERT INTO u1 SET a=1; +INSERT INTO u2 SET b=1; INSERT INTO t1(fld1) VALUES(1); INSERT INTO t2(fld1, fld2) VALUES(1, 2); --source include/restart_mysqld.inc UPDATE t1 SET fld1= 2; +DELETE FROM u1; +SELECT * FROM u2; +DROP TABLE u2,u1; SELECT fld3, fld1 FROM t2; alter TABLE t2 ADD INDEX vk(fld3, fld1), ALGORITHM=INPLACE; UPDATE t1 SET fld1=3; diff --git a/mysql-test/suite/gcol/t/innodb_virtual_index.test b/mysql-test/suite/gcol/t/innodb_virtual_index.test index 8f4e09fdf31..a89ae813b05 100644 --- a/mysql-test/suite/gcol/t/innodb_virtual_index.test +++ b/mysql-test/suite/gcol/t/innodb_virtual_index.test @@ -263,3 +263,22 @@ CREATE TABLE t1( INSERT INTO t1(b) VALUES(REPEAT('b',1000)); DELETE FROM t1; DROP TABLE t1; + +--echo # +--echo # Bug #22990029 GCOLS: INCORRECT BEHAVIOR +--echo # AFTER DATA INSERTED WITH IGNORE KEYWORD +--echo # + +CREATE TABLE t1(a INT PRIMARY KEY, b INT, vb DATE AS(b) VIRTUAL, KEY(vb)) +ENGINE=InnoDB; +INSERT IGNORE INTO t1 (a,b) VALUES(1,20190132); +BEGIN; +DELETE FROM t1; +--error ER_TRUNCATED_WRONG_VALUE +INSERT INTO t1 (a,b) VALUES(1,20190123); +SELECT * FROM t1; +ROLLBACK; +# MDEV-18366 FIXME: fix the crash and enable this +# SELECT * FROM t1; +CHECK TABLE t1; +DROP TABLE t1; |