Skip to content

Commit 1a3c365

Browse files
committed
Merge 10.2 into 10.3
2 parents e41eb04 + 5e9b341 commit 1a3c365

25 files changed

+637
-91
lines changed

cmake/build_configurations/mysql_release.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ ENDIF()
121121

122122
IF(UNIX)
123123
SET(WITH_EXTRA_CHARSETS all CACHE STRING "")
124+
SET(PLUGIN_AUTH_PAM YES)
124125

125126
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
126127
IF(NOT IGNORE_AIO_CHECK)

cmake/cpack_rpm.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ IF(CMAKE_VERSION VERSION_LESS "3.6.0")
3737
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${VERSION}-${RPM}-${CMAKE_SYSTEM_PROCESSOR}")
3838
ELSE()
3939
SET(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
40-
SET(CPACK_RPM_DEBUGINFO_PACKAGE ON CACHE INTERNAL "")
40+
OPTION(CPACK_RPM_DEBUGINFO_PACKAGE "" ON)
41+
MARK_AS_ADVANCED(CPACK_RPM_DEBUGINFO_PACKAGE)
4142
ENDIF()
4243

4344
SET(CPACK_RPM_PACKAGE_RELEASE "1%{?dist}")

include/my_time.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ longlong number_to_datetime(longlong nr, ulong sec_part, MYSQL_TIME *time_res,
120120
static inline
121121
longlong double_to_datetime(double nr, MYSQL_TIME *ltime, ulonglong flags, int *cut)
122122
{
123-
if (nr < 0 || nr > LONGLONG_MAX)
123+
if (nr < 0 || nr > (double)LONGLONG_MAX)
124124
nr= (double)LONGLONG_MAX;
125125
return number_to_datetime((longlong) floor(nr),
126126
(ulong)((nr-floor(nr))*TIME_SECOND_PART_FACTOR),

mysql-test/main/constraints.result

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,61 @@ t CREATE TABLE `t` (
129129
) ENGINE=MyISAM DEFAULT CHARSET=latin1
130130
DROP table test.t;
131131
SET @@SQL_MODE=@OLD_SQL_MODE;
132+
#
133+
# MDEV-16932 - ASAN heap-use-after-free in my_charlen_utf8 /
134+
# my_well_formed_char_length_utf8 on 2nd execution of SP with
135+
# ALTER trying to add bad CHECK
136+
#
137+
CREATE TABLE t1 (a INT);
138+
CREATE PROCEDURE sp() ALTER TABLE t1 ADD CONSTRAINT CHECK (b > 0);
139+
CALL sp;
140+
ERROR 42S22: Unknown column 'b' in 'CHECK'
141+
CALL sp;
142+
ERROR 42S22: Unknown column 'b' in 'CHECK'
143+
CALL sp;
144+
ERROR 42S22: Unknown column 'b' in 'CHECK'
145+
show create table t1;
146+
Table Create Table
147+
t1 CREATE TABLE `t1` (
148+
`a` int(11) DEFAULT NULL
149+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
150+
alter table t1 add column b int;
151+
CALL sp;
152+
show create table t1;
153+
Table Create Table
154+
t1 CREATE TABLE `t1` (
155+
`a` int(11) DEFAULT NULL,
156+
`b` int(11) DEFAULT NULL,
157+
CONSTRAINT `CONSTRAINT_1` CHECK (`b` > 0)
158+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
159+
CALL sp;
160+
show create table t1;
161+
Table Create Table
162+
t1 CREATE TABLE `t1` (
163+
`a` int(11) DEFAULT NULL,
164+
`b` int(11) DEFAULT NULL,
165+
CONSTRAINT `CONSTRAINT_1` CHECK (`b` > 0),
166+
CONSTRAINT `CONSTRAINT_2` CHECK (`b` > 0)
167+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
168+
DROP PROCEDURE sp;
169+
DROP TABLE t1;
170+
CREATE TABLE t1 (a INT);
171+
CREATE PROCEDURE sp() ALTER TABLE t1 ADD CONSTRAINT CHECK (b > 0);
172+
CALL sp;
173+
ERROR 42S22: Unknown column 'b' in 'CHECK'
174+
alter table t1 add column b int, add constraint check (b < 10);
175+
CALL sp;
176+
show create table t1;
177+
Table Create Table
178+
t1 CREATE TABLE `t1` (
179+
`a` int(11) DEFAULT NULL,
180+
`b` int(11) DEFAULT NULL,
181+
CONSTRAINT `CONSTRAINT_1` CHECK (`b` < 10),
182+
CONSTRAINT `CONSTRAINT_2` CHECK (`b` > 0)
183+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
184+
DROP PROCEDURE sp;
185+
DROP TABLE t1;
186+
# End of 10.2 tests
132187
create table t1 (a int check (a>10)) select 100 as 'a';
133188
show create table t1;
134189
Table Create Table

mysql-test/main/constraints.test

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,43 @@ SHOW CREATE TABLE t;
116116
DROP table test.t;
117117
SET @@SQL_MODE=@OLD_SQL_MODE;
118118

119+
--echo #
120+
--echo # MDEV-16932 - ASAN heap-use-after-free in my_charlen_utf8 /
121+
--echo # my_well_formed_char_length_utf8 on 2nd execution of SP with
122+
--echo # ALTER trying to add bad CHECK
123+
--echo #
124+
125+
CREATE TABLE t1 (a INT);
126+
CREATE PROCEDURE sp() ALTER TABLE t1 ADD CONSTRAINT CHECK (b > 0);
127+
--error ER_BAD_FIELD_ERROR
128+
CALL sp;
129+
--error ER_BAD_FIELD_ERROR
130+
CALL sp;
131+
--error ER_BAD_FIELD_ERROR
132+
CALL sp;
133+
show create table t1;
134+
alter table t1 add column b int;
135+
CALL sp;
136+
show create table t1;
137+
CALL sp;
138+
show create table t1;
139+
# Cleanup
140+
DROP PROCEDURE sp;
141+
DROP TABLE t1;
142+
143+
CREATE TABLE t1 (a INT);
144+
CREATE PROCEDURE sp() ALTER TABLE t1 ADD CONSTRAINT CHECK (b > 0);
145+
--error ER_BAD_FIELD_ERROR
146+
CALL sp;
147+
alter table t1 add column b int, add constraint check (b < 10);
148+
CALL sp;
149+
show create table t1;
150+
# Cleanup
151+
DROP PROCEDURE sp;
152+
DROP TABLE t1;
153+
154+
--echo # End of 10.2 tests
155+
119156
#
120157
# Check that we don't lose constraints as part of CREATE ... SELECT
121158
#

mysql-test/main/type_date.result

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,12 +872,14 @@ SELECT group_concat(d1/(CASE 'b' WHEN 'j' THEN 'c' END))
872872
FROM v1 GROUP BY greatest(pk, 0, d2);
873873
group_concat(d1/(CASE 'b' WHEN 'j' THEN 'c' END))
874874
NULL
875+
NULL
875876
Warnings:
876877
Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1
877878
Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 1
878879
Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1
879880
Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1
880881
Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 2
882+
Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 2
881883
CREATE TABLE t2 AS SELECT greatest(pk, 0, d2) AS c1 FROM t1 LIMIT 0;
882884
SHOW CREATE TABLE t2;
883885
Table Create Table
@@ -888,6 +890,37 @@ DROP TABLE t2;
888890
DROP VIEW v1;
889891
DROP TABLE t1;
890892
#
893+
# MDEV-19699 Server crashes in Item_null_result::field_type upon SELECT with ROLLUP on constant table
894+
#
895+
CREATE TABLE t1 (d DATE) ENGINE=MyISAM;
896+
INSERT INTO t1 VALUES ('1999-11-04');
897+
SELECT d FROM t1 GROUP BY d WITH ROLLUP HAVING d > '1990-01-01';
898+
d
899+
1999-11-04
900+
DROP TABLE t1;
901+
#
902+
# MDEV-20431 GREATEST(int_col,date_col) returns wrong results in a view
903+
#
904+
CREATE TABLE t1 (pk INT NOT NULL, d DATE NOT NULL);
905+
CREATE VIEW v1 AS SELECT * FROM t1;
906+
INSERT INTO t1 VALUES (1,'2018-06-22'),(2,'2018-07-11');
907+
SELECT GREATEST(pk, d) FROM t1;
908+
GREATEST(pk, d)
909+
2018-06-22
910+
2018-07-11
911+
Warnings:
912+
Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1
913+
Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 2
914+
SELECT GREATEST(pk, d) FROM v1;
915+
GREATEST(pk, d)
916+
2018-06-22
917+
2018-07-11
918+
Warnings:
919+
Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1
920+
Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 2
921+
DROP VIEW v1;
922+
DROP TABLE t1;
923+
#
891924
# End of 10.1 tests
892925
#
893926
#

mysql-test/main/type_date.test

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,30 @@ DROP TABLE t2;
606606
DROP VIEW v1;
607607
DROP TABLE t1;
608608

609+
610+
--echo #
611+
--echo # MDEV-19699 Server crashes in Item_null_result::field_type upon SELECT with ROLLUP on constant table
612+
--echo #
613+
614+
CREATE TABLE t1 (d DATE) ENGINE=MyISAM;
615+
INSERT INTO t1 VALUES ('1999-11-04');
616+
SELECT d FROM t1 GROUP BY d WITH ROLLUP HAVING d > '1990-01-01';
617+
DROP TABLE t1;
618+
619+
620+
--echo #
621+
--echo # MDEV-20431 GREATEST(int_col,date_col) returns wrong results in a view
622+
--echo #
623+
624+
CREATE TABLE t1 (pk INT NOT NULL, d DATE NOT NULL);
625+
CREATE VIEW v1 AS SELECT * FROM t1;
626+
INSERT INTO t1 VALUES (1,'2018-06-22'),(2,'2018-07-11');
627+
SELECT GREATEST(pk, d) FROM t1;
628+
SELECT GREATEST(pk, d) FROM v1;
629+
DROP VIEW v1;
630+
DROP TABLE t1;
631+
632+
609633
--echo #
610634
--echo # End of 10.1 tests
611635
--echo #

mysql-test/main/type_datetime.result

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,37 @@ INSERT INTO t2 SELECT * FROM t1;
11671167
DROP TABLE t1, t2;
11681168
SET SQL_MODE=DEFAULT;
11691169
#
1170+
# MDEV-19699 Server crashes in Item_null_result::field_type upon SELECT with ROLLUP on constant table
1171+
#
1172+
CREATE TABLE t1 (d DATETIME) ENGINE=MyISAM;
1173+
INSERT INTO t1 VALUES ('1999-11-04');
1174+
SELECT d FROM t1 GROUP BY d WITH ROLLUP HAVING d > '1990-01-01';
1175+
d
1176+
1999-11-04 00:00:00
1177+
DROP TABLE t1;
1178+
#
1179+
# MDEV-20431 GREATEST(int_col,date_col) returns wrong results in a view
1180+
#
1181+
CREATE TABLE t1 (pk INT NOT NULL, d DATETIME NOT NULL);
1182+
CREATE VIEW v1 AS SELECT * FROM t1;
1183+
INSERT INTO t1 VALUES (1,'2018-06-22 00:00:00'),(2,'2018-07-11 00:00:00');
1184+
SELECT GREATEST(pk, d) FROM t1;
1185+
GREATEST(pk, d)
1186+
2018-06-22 00:00:00
1187+
2018-07-11 00:00:00
1188+
Warnings:
1189+
Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1
1190+
Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 2
1191+
SELECT GREATEST(pk, d) FROM v1;
1192+
GREATEST(pk, d)
1193+
2018-06-22 00:00:00
1194+
2018-07-11 00:00:00
1195+
Warnings:
1196+
Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1
1197+
Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 2
1198+
DROP VIEW v1;
1199+
DROP TABLE t1;
1200+
#
11701201
# End of 10.1 tests
11711202
#
11721203
#

mysql-test/main/type_datetime.test

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,29 @@ DROP TABLE t1, t2;
724724
SET SQL_MODE=DEFAULT;
725725

726726

727+
--echo #
728+
--echo # MDEV-19699 Server crashes in Item_null_result::field_type upon SELECT with ROLLUP on constant table
729+
--echo #
730+
731+
CREATE TABLE t1 (d DATETIME) ENGINE=MyISAM;
732+
INSERT INTO t1 VALUES ('1999-11-04');
733+
SELECT d FROM t1 GROUP BY d WITH ROLLUP HAVING d > '1990-01-01';
734+
DROP TABLE t1;
735+
736+
737+
--echo #
738+
--echo # MDEV-20431 GREATEST(int_col,date_col) returns wrong results in a view
739+
--echo #
740+
741+
CREATE TABLE t1 (pk INT NOT NULL, d DATETIME NOT NULL);
742+
CREATE VIEW v1 AS SELECT * FROM t1;
743+
INSERT INTO t1 VALUES (1,'2018-06-22 00:00:00'),(2,'2018-07-11 00:00:00');
744+
SELECT GREATEST(pk, d) FROM t1;
745+
SELECT GREATEST(pk, d) FROM v1;
746+
DROP VIEW v1;
747+
DROP TABLE t1;
748+
749+
727750
--echo #
728751
--echo # End of 10.1 tests
729752
--echo #

mysql-test/suite/binlog/include/drop_temp_table.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,16 @@ RESET MASTER;
150150
--echo # Test case for DROP query.
151151

152152
--connection default
153-
CREATE TABLE t1 (a INT) ENGINE=INNODB;
153+
CREATE TABLE t2 (a INT) ENGINE=INNODB;
154154

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

158158
--connection default
159-
DROP TABLE t1;
159+
DROP TABLE t2;
160160

161161
--connection con1
162-
DROP TABLE t1;
162+
DROP TABLE t2;
163163

164164
--connection default
165165
--exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/bug28642318.sql

0 commit comments

Comments
 (0)