Skip to content
Permalink
Browse files

Merge 10.2 into 10.3

  • Loading branch information...
dr-m committed Aug 29, 2019
2 parents e41eb04 + 5e9b341 commit 1a3c36595320bd4cf94ba5ab6c5127129269af67
@@ -121,6 +121,7 @@ ENDIF()

IF(UNIX)
SET(WITH_EXTRA_CHARSETS all CACHE STRING "")
SET(PLUGIN_AUTH_PAM YES)

IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
IF(NOT IGNORE_AIO_CHECK)
@@ -37,7 +37,8 @@ IF(CMAKE_VERSION VERSION_LESS "3.6.0")
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${VERSION}-${RPM}-${CMAKE_SYSTEM_PROCESSOR}")
ELSE()
SET(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
SET(CPACK_RPM_DEBUGINFO_PACKAGE ON CACHE INTERNAL "")
OPTION(CPACK_RPM_DEBUGINFO_PACKAGE "" ON)
MARK_AS_ADVANCED(CPACK_RPM_DEBUGINFO_PACKAGE)
ENDIF()

SET(CPACK_RPM_PACKAGE_RELEASE "1%{?dist}")
@@ -120,7 +120,7 @@ longlong number_to_datetime(longlong nr, ulong sec_part, MYSQL_TIME *time_res,
static inline
longlong double_to_datetime(double nr, MYSQL_TIME *ltime, ulonglong flags, int *cut)
{
if (nr < 0 || nr > LONGLONG_MAX)
if (nr < 0 || nr > (double)LONGLONG_MAX)
nr= (double)LONGLONG_MAX;
return number_to_datetime((longlong) floor(nr),
(ulong)((nr-floor(nr))*TIME_SECOND_PART_FACTOR),
@@ -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
@@ -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
#
@@ -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
#
#
@@ -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 #
@@ -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
#
#
@@ -724,6 +724,29 @@ DROP TABLE t1, t2;
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 #
@@ -150,16 +150,16 @@ RESET MASTER;
--echo # Test case for DROP query.

--connection default
CREATE TABLE t1 (a INT) ENGINE=INNODB;
CREATE TABLE t2 (a INT) ENGINE=INNODB;

--connection con1
CREATE TEMPORARY TABLE t1 (b BLOB) ENGINE=INNODB;
CREATE TEMPORARY TABLE t2 (b BLOB) ENGINE=INNODB;

--connection default
DROP TABLE t1;
DROP TABLE t2;

--connection con1
DROP TABLE t1;
DROP TABLE t2;

--connection default
--exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/bug28642318.sql
@@ -88,13 +88,13 @@ DROP TABLE IF EXISTS t1;
RESET MASTER;
# Test case for DROP query.
connection default;
CREATE TABLE t1 (a INT) ENGINE=INNODB;
CREATE TABLE t2 (a INT) ENGINE=INNODB;
connection con1;
CREATE TEMPORARY TABLE t1 (b BLOB) ENGINE=INNODB;
CREATE TEMPORARY TABLE t2 (b BLOB) ENGINE=INNODB;
connection default;
DROP TABLE t1;
DROP TABLE t2;
connection con1;
DROP TABLE t1;
DROP TABLE t2;
connection default;
# DROP table query fails with unknown table error without patch.
# Clean up
@@ -116,13 +116,13 @@ DROP TABLE IF EXISTS t1;
RESET MASTER;
# Test case for DROP query.
connection default;
CREATE TABLE t1 (a INT) ENGINE=INNODB;
CREATE TABLE t2 (a INT) ENGINE=INNODB;
connection con1;
CREATE TEMPORARY TABLE t1 (b BLOB) ENGINE=INNODB;
CREATE TEMPORARY TABLE t2 (b BLOB) ENGINE=INNODB;
connection default;
DROP TABLE t1;
DROP TABLE t2;
connection con1;
DROP TABLE t1;
DROP TABLE t2;
connection default;
# DROP table query fails with unknown table error without patch.
# Clean up
@@ -196,7 +196,6 @@ DROP TABLE t2;
# Bug 21433768: NON-REPEATABLE READ WITH REPEATABLE READ ISOLATION
#
connect con1,localhost,root,,;
# connection con1
CREATE TABLE t1(col1 INT PRIMARY KEY, col2 INT) ENGINE = InnoDB;
INSERT INTO t1 values (1, 0), (2, 0);
SELECT * FROM t1 ORDER BY col1;
@@ -208,7 +207,6 @@ UPDATE t1 SET col2 = 100;
SET DEBUG_SYNC = 'after_trx_committed_in_memory SIGNAL s1 WAIT_FOR s2';
COMMIT;;
connection default;
# connection default
SET DEBUG_SYNC = 'now WAIT_FOR s1';
UPDATE t1 SET col2 = col2 + 10 where col1 = 1;
COMMIT;
@@ -218,10 +216,7 @@ col1 col2
2 100
SET DEBUG_SYNC = 'now SIGNAL s2';
connection con1;
# connection con1
# reap COMMIT for con1
connection default;
# connection default
disconnect con1;
connection default;
DROP TABLE t1;
SET DEBUG_SYNC= 'RESET';

0 comments on commit 1a3c365

Please sign in to comment.
You can’t perform that action at this time.