diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-08-29 08:41:53 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-08-29 12:00:12 +0300 |
commit | 1a3c36595320bd4cf94ba5ab6c5127129269af67 (patch) | |
tree | 72954842785e24025db2b2638940251993142989 /mysql-test/main | |
parent | e41eb044f19e3ee9b881344565924dd6b9d20e1a (diff) | |
parent | 5e9b34191e395ced03fbbbe6aedc07b0a7293984 (diff) | |
download | mariadb-git-1a3c36595320bd4cf94ba5ab6c5127129269af67.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main')
-rw-r--r-- | mysql-test/main/constraints.result | 55 | ||||
-rw-r--r-- | mysql-test/main/constraints.test | 37 | ||||
-rw-r--r-- | mysql-test/main/type_date.result | 33 | ||||
-rw-r--r-- | mysql-test/main/type_date.test | 24 | ||||
-rw-r--r-- | mysql-test/main/type_datetime.result | 31 | ||||
-rw-r--r-- | mysql-test/main/type_datetime.test | 23 |
6 files changed, 203 insertions, 0 deletions
diff --git a/mysql-test/main/constraints.result b/mysql-test/main/constraints.result index 0b7577dd3ac..24f8417d313 100644 --- a/mysql-test/main/constraints.result +++ b/mysql-test/main/constraints.result @@ -129,6 +129,61 @@ t CREATE TABLE `t` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP table test.t; SET @@SQL_MODE=@OLD_SQL_MODE; +# +# MDEV-16932 - ASAN heap-use-after-free in my_charlen_utf8 / +# my_well_formed_char_length_utf8 on 2nd execution of SP with +# ALTER trying to add bad CHECK +# +CREATE TABLE t1 (a INT); +CREATE PROCEDURE sp() ALTER TABLE t1 ADD CONSTRAINT CHECK (b > 0); +CALL sp; +ERROR 42S22: Unknown column 'b' in 'CHECK' +CALL sp; +ERROR 42S22: Unknown column 'b' in 'CHECK' +CALL sp; +ERROR 42S22: Unknown column 'b' in 'CHECK' +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +alter table t1 add column b int; +CALL sp; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + CONSTRAINT `CONSTRAINT_1` CHECK (`b` > 0) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +CALL sp; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + CONSTRAINT `CONSTRAINT_1` CHECK (`b` > 0), + CONSTRAINT `CONSTRAINT_2` CHECK (`b` > 0) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP PROCEDURE sp; +DROP TABLE t1; +CREATE TABLE t1 (a INT); +CREATE PROCEDURE sp() ALTER TABLE t1 ADD CONSTRAINT CHECK (b > 0); +CALL sp; +ERROR 42S22: Unknown column 'b' in 'CHECK' +alter table t1 add column b int, add constraint check (b < 10); +CALL sp; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + CONSTRAINT `CONSTRAINT_1` CHECK (`b` < 10), + CONSTRAINT `CONSTRAINT_2` CHECK (`b` > 0) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP PROCEDURE sp; +DROP TABLE t1; +# End of 10.2 tests 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 d7a5b41d708..2f4dadcee9d 100644 --- a/mysql-test/main/constraints.test +++ b/mysql-test/main/constraints.test @@ -116,6 +116,43 @@ SHOW CREATE TABLE t; DROP table test.t; SET @@SQL_MODE=@OLD_SQL_MODE; +--echo # +--echo # MDEV-16932 - ASAN heap-use-after-free in my_charlen_utf8 / +--echo # my_well_formed_char_length_utf8 on 2nd execution of SP with +--echo # ALTER trying to add bad CHECK +--echo # + +CREATE TABLE t1 (a INT); +CREATE PROCEDURE sp() ALTER TABLE t1 ADD CONSTRAINT CHECK (b > 0); +--error ER_BAD_FIELD_ERROR +CALL sp; +--error ER_BAD_FIELD_ERROR +CALL sp; +--error ER_BAD_FIELD_ERROR +CALL sp; +show create table t1; +alter table t1 add column b int; +CALL sp; +show create table t1; +CALL sp; +show create table t1; +# Cleanup +DROP PROCEDURE sp; +DROP TABLE t1; + +CREATE TABLE t1 (a INT); +CREATE PROCEDURE sp() ALTER TABLE t1 ADD CONSTRAINT CHECK (b > 0); +--error ER_BAD_FIELD_ERROR +CALL sp; +alter table t1 add column b int, add constraint check (b < 10); +CALL sp; +show create table t1; +# Cleanup +DROP PROCEDURE sp; +DROP TABLE t1; + +--echo # End of 10.2 tests + # # Check that we don't lose constraints as part of CREATE ... SELECT # diff --git a/mysql-test/main/type_date.result b/mysql-test/main/type_date.result index 4b5a0ad63a0..b5225a591ce 100644 --- a/mysql-test/main/type_date.result +++ b/mysql-test/main/type_date.result @@ -872,12 +872,14 @@ SELECT group_concat(d1/(CASE 'b' WHEN 'j' THEN 'c' END)) FROM v1 GROUP BY greatest(pk, 0, d2); group_concat(d1/(CASE 'b' WHEN 'j' THEN 'c' END)) NULL +NULL Warnings: Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1 Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 1 Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1 Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1 Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 2 +Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 2 CREATE TABLE t2 AS SELECT greatest(pk, 0, d2) AS c1 FROM t1 LIMIT 0; SHOW CREATE TABLE t2; Table Create Table @@ -888,6 +890,37 @@ DROP TABLE t2; DROP VIEW v1; DROP TABLE t1; # +# MDEV-19699 Server crashes in Item_null_result::field_type upon SELECT with ROLLUP on constant table +# +CREATE TABLE t1 (d DATE) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('1999-11-04'); +SELECT d FROM t1 GROUP BY d WITH ROLLUP HAVING d > '1990-01-01'; +d +1999-11-04 +DROP TABLE t1; +# +# MDEV-20431 GREATEST(int_col,date_col) returns wrong results in a view +# +CREATE TABLE t1 (pk INT NOT NULL, d DATE NOT NULL); +CREATE VIEW v1 AS SELECT * FROM t1; +INSERT INTO t1 VALUES (1,'2018-06-22'),(2,'2018-07-11'); +SELECT GREATEST(pk, d) FROM t1; +GREATEST(pk, d) +2018-06-22 +2018-07-11 +Warnings: +Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1 +Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 2 +SELECT GREATEST(pk, d) FROM v1; +GREATEST(pk, d) +2018-06-22 +2018-07-11 +Warnings: +Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1 +Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 2 +DROP VIEW v1; +DROP TABLE t1; +# # End of 10.1 tests # # diff --git a/mysql-test/main/type_date.test b/mysql-test/main/type_date.test index befee57183d..834fad65d4d 100644 --- a/mysql-test/main/type_date.test +++ b/mysql-test/main/type_date.test @@ -606,6 +606,30 @@ DROP TABLE t2; DROP VIEW v1; DROP TABLE t1; + +--echo # +--echo # MDEV-19699 Server crashes in Item_null_result::field_type upon SELECT with ROLLUP on constant table +--echo # + +CREATE TABLE t1 (d DATE) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('1999-11-04'); +SELECT d FROM t1 GROUP BY d WITH ROLLUP HAVING d > '1990-01-01'; +DROP TABLE t1; + + +--echo # +--echo # MDEV-20431 GREATEST(int_col,date_col) returns wrong results in a view +--echo # + +CREATE TABLE t1 (pk INT NOT NULL, d DATE NOT NULL); +CREATE VIEW v1 AS SELECT * FROM t1; +INSERT INTO t1 VALUES (1,'2018-06-22'),(2,'2018-07-11'); +SELECT GREATEST(pk, d) FROM t1; +SELECT GREATEST(pk, d) FROM v1; +DROP VIEW v1; +DROP TABLE t1; + + --echo # --echo # End of 10.1 tests --echo # diff --git a/mysql-test/main/type_datetime.result b/mysql-test/main/type_datetime.result index 923d6a3783c..a7a9eece0da 100644 --- a/mysql-test/main/type_datetime.result +++ b/mysql-test/main/type_datetime.result @@ -1167,6 +1167,37 @@ INSERT INTO t2 SELECT * FROM t1; DROP TABLE t1, t2; SET SQL_MODE=DEFAULT; # +# MDEV-19699 Server crashes in Item_null_result::field_type upon SELECT with ROLLUP on constant table +# +CREATE TABLE t1 (d DATETIME) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('1999-11-04'); +SELECT d FROM t1 GROUP BY d WITH ROLLUP HAVING d > '1990-01-01'; +d +1999-11-04 00:00:00 +DROP TABLE t1; +# +# MDEV-20431 GREATEST(int_col,date_col) returns wrong results in a view +# +CREATE TABLE t1 (pk INT NOT NULL, d DATETIME NOT NULL); +CREATE VIEW v1 AS SELECT * FROM t1; +INSERT INTO t1 VALUES (1,'2018-06-22 00:00:00'),(2,'2018-07-11 00:00:00'); +SELECT GREATEST(pk, d) FROM t1; +GREATEST(pk, d) +2018-06-22 00:00:00 +2018-07-11 00:00:00 +Warnings: +Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1 +Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 2 +SELECT GREATEST(pk, d) FROM v1; +GREATEST(pk, d) +2018-06-22 00:00:00 +2018-07-11 00:00:00 +Warnings: +Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1 +Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 2 +DROP VIEW v1; +DROP TABLE t1; +# # End of 10.1 tests # # diff --git a/mysql-test/main/type_datetime.test b/mysql-test/main/type_datetime.test index baf85187099..2445925cb80 100644 --- a/mysql-test/main/type_datetime.test +++ b/mysql-test/main/type_datetime.test @@ -725,6 +725,29 @@ SET SQL_MODE=DEFAULT; --echo # +--echo # MDEV-19699 Server crashes in Item_null_result::field_type upon SELECT with ROLLUP on constant table +--echo # + +CREATE TABLE t1 (d DATETIME) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('1999-11-04'); +SELECT d FROM t1 GROUP BY d WITH ROLLUP HAVING d > '1990-01-01'; +DROP TABLE t1; + + +--echo # +--echo # MDEV-20431 GREATEST(int_col,date_col) returns wrong results in a view +--echo # + +CREATE TABLE t1 (pk INT NOT NULL, d DATETIME NOT NULL); +CREATE VIEW v1 AS SELECT * FROM t1; +INSERT INTO t1 VALUES (1,'2018-06-22 00:00:00'),(2,'2018-07-11 00:00:00'); +SELECT GREATEST(pk, d) FROM t1; +SELECT GREATEST(pk, d) FROM v1; +DROP VIEW v1; +DROP TABLE t1; + + +--echo # --echo # End of 10.1 tests --echo # |