diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-05-02 21:43:24 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-05-02 21:43:24 +0300 |
commit | 158247d3bdd5cc36dd37568c76e7db081b19eb5a (patch) | |
tree | 88c62e896b0758847a9eea2311dc1a7d587708f4 /mysql-test | |
parent | 0d6fb43e6d6ca1eb9060d7369efcbabcda324f1e (diff) | |
parent | 2370eeb028b269243633b18f7661dca999089a41 (diff) | |
download | mariadb-git-158247d3bdd5cc36dd37568c76e7db081b19eb5a.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/main/constraints.result | 20 | ||||
-rw-r--r-- | mysql-test/main/constraints.test | 23 | ||||
-rw-r--r-- | mysql-test/main/trigger.result | 32 | ||||
-rw-r--r-- | mysql-test/main/trigger.test | 34 |
4 files changed, 91 insertions, 18 deletions
diff --git a/mysql-test/main/constraints.result b/mysql-test/main/constraints.result index aba226cdd33..0b7577dd3ac 100644 --- a/mysql-test/main/constraints.result +++ b/mysql-test/main/constraints.result @@ -1,4 +1,3 @@ -drop table if exists t1; create table t1 (a int check (a>0)); show create table t1; Table Create Table @@ -111,6 +110,25 @@ long_enough_name CREATE TABLE `long_enough_name` ( CONSTRAINT `constr` CHECK (`f6` >= 0) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE long_enough_name; +CREATE TABLE test.t(t int COMMENT 't_comment' CHECK(t>0)); +SHOW CREATE TABLE test.t; +Table Create Table +t CREATE TABLE `t` ( + `t` int(11) DEFAULT NULL COMMENT 't_comment' CHECK (`t` > 0) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP table test.t; +SET @OLD_SQL_MODE=@@SQL_MODE; +SET SQL_MODE='IGNORE_BAD_TABLE_OPTIONS'; +CREATE TABLE test.t (f int foo=bar check(f>0)); +Warnings: +Warning 1911 Unknown option 'foo' +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `f` int(11) DEFAULT NULL `foo`=bar CHECK (`f` > 0) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP table test.t; +SET @@SQL_MODE=@OLD_SQL_MODE; create table t1 (a int check (a>10)) select 100 as 'a'; show create table t1; Table Create Table diff --git a/mysql-test/main/constraints.test b/mysql-test/main/constraints.test index c06f585d04f..d7a5b41d708 100644 --- a/mysql-test/main/constraints.test +++ b/mysql-test/main/constraints.test @@ -1,10 +1,6 @@ # # Testing of constraints # ---disable_warnings -drop table if exists t1; ---enable_warnings - create table t1 (a int check (a>0)); show create table t1; insert into t1 values (1); @@ -104,7 +100,24 @@ SHOW CREATE TABLE long_enough_name; DROP TABLE long_enough_name; # -# Check that we don't loose constraints as part of CREATE ... SELECT +# MDEV-17654 Incorrect syntax returned for column with CHECK constraint +# in the "SHOW CREATE TABLE ..." result +# + +CREATE TABLE test.t(t int COMMENT 't_comment' CHECK(t>0)); +SHOW CREATE TABLE test.t; +DROP table test.t; + +SET @OLD_SQL_MODE=@@SQL_MODE; +SET SQL_MODE='IGNORE_BAD_TABLE_OPTIONS'; + +CREATE TABLE test.t (f int foo=bar check(f>0)); +SHOW CREATE TABLE t; +DROP table test.t; +SET @@SQL_MODE=@OLD_SQL_MODE; + +# +# Check that we don't lose constraints as part of CREATE ... SELECT # create table t1 (a int check (a>10)) select 100 as 'a'; diff --git a/mysql-test/main/trigger.result b/mysql-test/main/trigger.result index 69308009928..b6d8be5d364 100644 --- a/mysql-test/main/trigger.result +++ b/mysql-test/main/trigger.result @@ -1962,7 +1962,7 @@ ERROR HY000: Can't update table 't2' in stored function/trigger because it is al DROP TABLE t1; DROP TRIGGER t_insert; DROP TABLE t2; -End of 5.0 tests +# End of 5.0 tests drop table if exists table_25411_a; drop table if exists table_25411_b; create table table_25411_a(a int); @@ -2131,7 +2131,7 @@ b # Work around Bug#45235 DROP DATABASE db1; USE test; -End of 5.1 tests. +# End of 5.1 tests. create table t1 (i int); create table t2 (i int); flush tables; @@ -2150,7 +2150,7 @@ select * from t2; i 2 drop table t1,t2; -End of 5.2 tests. +# End of 5.2 tests. # # Bug#34453 Can't change size of file (Errcode: 1224) # @@ -2253,7 +2253,7 @@ c aaa DROP TABLE t1; -End of 5.5 tests. +# End of 5.5 tests. # # BUG #910083: materialized subquery in a trigger # @@ -2300,7 +2300,7 @@ b SET optimizer_switch=@save_optimizer_switch; DROP TRIGGER tr; DROP TABLE t1, t2; -End of 5.3 tests. +# End of 5.3 tests. set time_zone="+00:00"; SET TIMESTAMP=UNIX_TIMESTAMP('2001-01-01 10:20:30'); SET @@session.sql_mode = 'STRICT_ALL_TABLES,STRICT_TRANS_TABLES'; @@ -2407,7 +2407,24 @@ AFTER UPDATE ON t1 FOR EACH ROW SELECT (SELECT b FROM t2) INTO @x; # Running 20000 queries DROP TABLE t1,t2; # -# Start of 10.3 tests +# MDEV-19188 Server Crash When Using a Trigger With A Number of Virtual Columns on INSERT/UPDATE +# +CREATE TABLE t1 ( +virt1 INT GENERATED ALWAYS AS (0) VIRTUAL, +virt2 INT GENERATED ALWAYS AS (0) VIRTUAL, +virt3 INT GENERATED ALWAYS AS (0) VIRTUAL, +virt4 INT GENERATED ALWAYS AS (0) VIRTUAL, +virt5 INT GENERATED ALWAYS AS (0) VIRTUAL, +virt6 INT GENERATED ALWAYS AS (0) VIRTUAL, +virt7 INT GENERATED ALWAYS AS (0) VIRTUAL, +virt8 INT GENERATED ALWAYS AS (0) VIRTUAL +); +INSERT INTO t1 () VALUES (); +CREATE TRIGGER t1_trigger BEFORE INSERT ON t1 FOR EACH ROW BEGIN END; +INSERT INTO t1 () VALUES (); +DROP TABLE t1; +# +# End of 10.2 tests # # # MDEV-12461 TYPE OF and ROW TYPE OF anchored data types @@ -2426,3 +2443,6 @@ SELECT * FROM t1; a b total 10 20 30 DROP TABLE t1; +# +# End of 10.3 tests +# diff --git a/mysql-test/main/trigger.test b/mysql-test/main/trigger.test index 020117e046f..2eeab16ec5a 100644 --- a/mysql-test/main/trigger.test +++ b/mysql-test/main/trigger.test @@ -2184,7 +2184,7 @@ DROP TABLE t1; DROP TRIGGER t_insert; DROP TABLE t2; ---echo End of 5.0 tests +--echo # End of 5.0 tests # # Bug#25411 (trigger code truncated) @@ -2406,7 +2406,7 @@ let $MYSQLD_DATADIR = `select @@datadir`; DROP DATABASE db1; USE test; ---echo End of 5.1 tests. +--echo # End of 5.1 tests. # # Test that using a trigger will not open mysql.proc @@ -2430,7 +2430,7 @@ select * from t1; select * from t2; drop table t1,t2; ---echo End of 5.2 tests. +--echo # End of 5.2 tests. --echo # --echo # Bug#34453 Can't change size of file (Errcode: 1224) @@ -2574,7 +2574,7 @@ SELECT c FROM t1; DROP TABLE t1; --echo ---echo End of 5.5 tests. +--echo # End of 5.5 tests. --echo # --echo # BUG #910083: materialized subquery in a trigger @@ -2613,7 +2613,7 @@ SET optimizer_switch=@save_optimizer_switch; DROP TRIGGER tr; DROP TABLE t1, t2; ---echo End of 5.3 tests. +--echo # End of 5.3 tests. # # MDEV-4829 BEFORE INSERT triggers dont issue 1406 error @@ -2737,9 +2737,27 @@ while ($n) DROP TABLE t1,t2; +--echo # +--echo # MDEV-19188 Server Crash When Using a Trigger With A Number of Virtual Columns on INSERT/UPDATE +--echo # + +CREATE TABLE t1 ( + virt1 INT GENERATED ALWAYS AS (0) VIRTUAL, + virt2 INT GENERATED ALWAYS AS (0) VIRTUAL, + virt3 INT GENERATED ALWAYS AS (0) VIRTUAL, + virt4 INT GENERATED ALWAYS AS (0) VIRTUAL, + virt5 INT GENERATED ALWAYS AS (0) VIRTUAL, + virt6 INT GENERATED ALWAYS AS (0) VIRTUAL, + virt7 INT GENERATED ALWAYS AS (0) VIRTUAL, + virt8 INT GENERATED ALWAYS AS (0) VIRTUAL +); +INSERT INTO t1 () VALUES (); +CREATE TRIGGER t1_trigger BEFORE INSERT ON t1 FOR EACH ROW BEGIN END; +INSERT INTO t1 () VALUES (); +DROP TABLE t1; --echo # ---echo # Start of 10.3 tests +--echo # End of 10.2 tests --echo # --echo # @@ -2760,3 +2778,7 @@ DELIMITER ;$$ INSERT INTO t1 (a,b) VALUES (10, 20); SELECT * FROM t1; DROP TABLE t1; + +--echo # +--echo # End of 10.3 tests +--echo # |