Skip to content

Commit 73985d8

Browse files
committed
Merge 10.1 into 10.2
2 parents 496532b + aade6e5 commit 73985d8

33 files changed

+377
-116
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ PenaltyExcessCharacter: 1000000
9090
PenaltyReturnTypeOnItsOwnLine: 60
9191
PointerAlignment: Right
9292
ReflowComments: true
93-
SortIncludes: true
93+
SortIncludes: false
9494
SortUsingDeclarations: true
9595
SpaceAfterCStyleCast: true
9696
SpaceAfterLogicalNot: false

mysql-test/include/binlog_parallel_replication_marks.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ while (<F>) {
8080
s/table id \d+/table id #/;
8181
s/mapped to number \d+/mapped to number #/;
8282
s/CRC32 0x[0-9a-f]+/CRC32 0x########/;
83-
print if /GTID|BEGIN|COMMIT|Table_map|Write_rows|Update_rows|Delete_rows|generated by server|40005 TEMPORARY/;
83+
print if /\b(GTID|BEGIN|COMMIT|Table_map|Write_rows|Update_rows|Delete_rows|generated by server|40005 TEMPORARY)\b/;
8484
}
8585
close F;
8686
EOF

mysql-test/mysql-test-run.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4621,6 +4621,8 @@ ($$)
46214621
qr/missing DBUG_RETURN/,
46224622
qr/Attempting backtrace/,
46234623
qr/Assertion .* failed/,
4624+
qr/Sanitizer/,
4625+
qr/runtime error:/,
46244626
);
46254627
# These are taken from the include/mtr_warnings.sql global suppression
46264628
# list. They occur delayed, so they can be parsed during shutdown rather

mysql-test/r/mysql_tzinfo_to_sql_symlink.result

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Verbose run
55
\d |
66
IF (select count(*) from information_schema.global_variables where
7-
variable_name='wsrep_on') = 1 THEN
7+
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
88
ALTER TABLE time_zone ENGINE=InnoDB;
99
ALTER TABLE time_zone_name ENGINE=InnoDB;
1010
ALTER TABLE time_zone_transition ENGINE=InnoDB;
@@ -36,7 +36,7 @@ ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
3636
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
3737
\d |
3838
IF (select count(*) from information_schema.global_variables where
39-
variable_name='wsrep_on') = 1 THEN
39+
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
4040
ALTER TABLE time_zone ENGINE=MyISAM;
4141
ALTER TABLE time_zone_name ENGINE=MyISAM;
4242
ALTER TABLE time_zone_transition ENGINE=MyISAM;
@@ -46,7 +46,7 @@ END IF|
4646
# Silent run
4747
\d |
4848
IF (select count(*) from information_schema.global_variables where
49-
variable_name='wsrep_on') = 1 THEN
49+
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
5050
ALTER TABLE time_zone ENGINE=InnoDB;
5151
ALTER TABLE time_zone_name ENGINE=InnoDB;
5252
ALTER TABLE time_zone_transition ENGINE=InnoDB;
@@ -75,7 +75,7 @@ ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
7575
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
7676
\d |
7777
IF (select count(*) from information_schema.global_variables where
78-
variable_name='wsrep_on') = 1 THEN
78+
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
7979
ALTER TABLE time_zone ENGINE=MyISAM;
8080
ALTER TABLE time_zone_name ENGINE=MyISAM;
8181
ALTER TABLE time_zone_transition ENGINE=MyISAM;
@@ -93,7 +93,7 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset,
9393
;
9494
\d |
9595
IF (select count(*) from information_schema.global_variables where
96-
variable_name='wsrep_on') = 1 THEN
96+
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
9797
ALTER TABLE time_zone ENGINE=MyISAM;
9898
ALTER TABLE time_zone_name ENGINE=MyISAM;
9999
ALTER TABLE time_zone_transition ENGINE=MyISAM;
@@ -105,21 +105,21 @@ END IF|
105105
#
106106
\d |
107107
IF (select count(*) from information_schema.global_variables where
108-
variable_name='wsrep_on') = 1 THEN
108+
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
109109
ALTER TABLE time_zone_leap_second ENGINE=InnoDB;
110110
END IF|
111111
\d ;
112112
TRUNCATE TABLE time_zone_leap_second;
113113
\d |
114114
IF (select count(*) from information_schema.global_variables where
115-
variable_name='wsrep_on') = 1 THEN
115+
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
116116
ALTER TABLE time_zone_leap_second ENGINE=MyISAM;
117117
END IF|
118118
\d ;
119119
ALTER TABLE time_zone_leap_second ORDER BY Transition_time;
120120
\d |
121121
IF (select count(*) from information_schema.global_variables where
122-
variable_name='wsrep_on') = 1 THEN
122+
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
123123
ALTER TABLE time_zone ENGINE=MyISAM;
124124
ALTER TABLE time_zone_name ENGINE=MyISAM;
125125
ALTER TABLE time_zone_transition ENGINE=MyISAM;
@@ -131,7 +131,7 @@ END IF|
131131
#
132132
\d |
133133
IF (select count(*) from information_schema.global_variables where
134-
variable_name='wsrep_on') = 1 THEN
134+
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
135135
ALTER TABLE time_zone ENGINE=InnoDB;
136136
ALTER TABLE time_zone_name ENGINE=InnoDB;
137137
ALTER TABLE time_zone_transition ENGINE=InnoDB;
@@ -146,7 +146,7 @@ ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
146146
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
147147
\d |
148148
IF (select count(*) from information_schema.global_variables where
149-
variable_name='wsrep_on') = 1 THEN
149+
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
150150
ALTER TABLE time_zone ENGINE=MyISAM;
151151
ALTER TABLE time_zone_name ENGINE=MyISAM;
152152
ALTER TABLE time_zone_transition ENGINE=MyISAM;

mysql-test/r/type_datetime.result

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,87 @@ Warning 1292 Incorrect datetime value: '2' for column `test`.`t1`.`pk` at row 2
11981198
DROP VIEW v1;
11991199
DROP TABLE t1;
12001200
#
1201+
# MDEV-21319 COUNT(*) returns 1, actual SELECT returns no result in 10.3.21, but 1 result in 10.1.41
1202+
#
1203+
CREATE TABLE t1
1204+
(
1205+
id INT NOT NULL PRIMARY KEY,
1206+
id2 INT,
1207+
k TINYINT,
1208+
j INT,
1209+
t DATETIME,
1210+
KEY k1 (id2,k,j,t)
1211+
);
1212+
INSERT INTO t1 VALUES
1213+
(53,54,1,0,'2019-12-13 10:09:59'),
1214+
(54,54,1,0,'2019-12-13 16:28:41'),
1215+
(55,54,1,0,'2019-12-13 16:29:10'),
1216+
(56,54,1,0,'2019-12-13 16:29:43'),
1217+
(57,54,1,0,'2019-12-13 16:30:16'),
1218+
(58,54,1,0,'2019-12-13 16:30:49'),
1219+
(59,54,1,0,'2019-12-13 16:31:23'),
1220+
(60,54,1,0,'2019-12-13 16:31:55'),
1221+
(61,54,1,0,'2019-12-13 16:32:28'),
1222+
(62,54,1,0,'2019-12-13 16:33:01'),
1223+
(63,54,1,0,'2019-12-13 16:33:34'),
1224+
(64,54,1,0,'2019-12-13 16:34:07'),
1225+
(65,54,1,0,'2019-12-13 16:34:40'),
1226+
(66,54,1,0,'2019-12-13 16:35:13'),
1227+
(67,54,1,0,'2019-12-13 16:35:46'),
1228+
(68,54,1,0,'2019-12-13 16:36:19');
1229+
SELECT t FROM t1 GROUP BY t HAVING t=max(t);
1230+
t
1231+
2019-12-13 10:09:59
1232+
2019-12-13 16:28:41
1233+
2019-12-13 16:29:10
1234+
2019-12-13 16:29:43
1235+
2019-12-13 16:30:16
1236+
2019-12-13 16:30:49
1237+
2019-12-13 16:31:23
1238+
2019-12-13 16:31:55
1239+
2019-12-13 16:32:28
1240+
2019-12-13 16:33:01
1241+
2019-12-13 16:33:34
1242+
2019-12-13 16:34:07
1243+
2019-12-13 16:34:40
1244+
2019-12-13 16:35:13
1245+
2019-12-13 16:35:46
1246+
2019-12-13 16:36:19
1247+
SELECT t FROM t1 WHERE id2=54 and j=0 and k=1 GROUP BY t HAVING t=max(t);
1248+
t
1249+
2019-12-13 10:09:59
1250+
2019-12-13 16:28:41
1251+
2019-12-13 16:29:10
1252+
2019-12-13 16:29:43
1253+
2019-12-13 16:30:16
1254+
2019-12-13 16:30:49
1255+
2019-12-13 16:31:23
1256+
2019-12-13 16:31:55
1257+
2019-12-13 16:32:28
1258+
2019-12-13 16:33:01
1259+
2019-12-13 16:33:34
1260+
2019-12-13 16:34:07
1261+
2019-12-13 16:34:40
1262+
2019-12-13 16:35:13
1263+
2019-12-13 16:35:46
1264+
2019-12-13 16:36:19
1265+
DROP TABLE t1;
1266+
CREATE TABLE t1 (pk INT);
1267+
CREATE VIEW v1 AS SELECT * FROM t1;
1268+
INSERT INTO t1 VALUES (1);
1269+
SELECT pk<DATE'2001-01-01' FROM t1 GROUP BY pk;
1270+
pk<DATE'2001-01-01'
1271+
1
1272+
Warnings:
1273+
Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1
1274+
SELECT pk<DATE'2001-01-01' FROM v1 GROUP BY pk;
1275+
pk<DATE'2001-01-01'
1276+
1
1277+
Warnings:
1278+
Warning 1292 Incorrect datetime value: '1' for column `test`.`t1`.`pk` at row 1
1279+
DROP VIEW v1;
1280+
DROP TABLE t1;
1281+
#
12011282
# End of 10.1 tests
12021283
#
12031284
#

mysql-test/r/type_int.result

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ COALESCE(@a)
2020
1
2121
DROP TABLE t1;
2222
#
23+
# MDEV-21065 UNIQUE constraint causes a query with string comparison to omit a row in the result set
24+
#
25+
CREATE TABLE t1 (c0 INT UNIQUE);
26+
INSERT INTO t1 VALUES (NULL), (NULL), (NULL), (NULL), (1), (0);
27+
SELECT * FROM t1 WHERE c0 < '\n2';
28+
c0
29+
0
30+
1
31+
DROP TABLE t1;
32+
SELECT CAST('\n2' AS INT);
33+
CAST('\n2' AS INT)
34+
2
35+
#
2336
# End of 5.5 tests
2437
#
2538
#

mysql-test/r/type_time.result

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,6 +1246,72 @@ drop table t1;
12461246
SET @@optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
12471247
set @@old_mode= @save_old_mode;
12481248
#
1249+
# MDEV-21319 COUNT(*) returns 1, actual SELECT returns no result in 10.3.21, but 1 result in 10.1.41
1250+
#
1251+
CREATE OR REPLACE TABLE t1
1252+
(
1253+
id INT NOT NULL PRIMARY KEY,
1254+
id2 INT,
1255+
k TINYINT,
1256+
j INT,
1257+
t TIME,
1258+
KEY k1 (id2,k,j,t)
1259+
);
1260+
INSERT INTO t1 VALUES
1261+
(53,54,1,0,'10:09:59'),
1262+
(54,54,1,0,'16:28:41'),
1263+
(55,54,1,0,'16:29:10'),
1264+
(56,54,1,0,'16:29:43'),
1265+
(57,54,1,0,'16:30:16'),
1266+
(58,54,1,0,'16:30:49'),
1267+
(59,54,1,0,'16:31:23'),
1268+
(60,54,1,0,'16:31:55'),
1269+
(61,54,1,0,'16:32:28'),
1270+
(62,54,1,0,'16:33:01'),
1271+
(63,54,1,0,'16:33:34'),
1272+
(64,54,1,0,'16:34:07'),
1273+
(65,54,1,0,'16:34:40'),
1274+
(66,54,1,0,'16:35:13'),
1275+
(67,54,1,0,'16:35:46'),
1276+
(68,54,1,0,'16:36:19');
1277+
SELECT t FROM t1 GROUP BY t HAVING t=MAX(t);
1278+
t
1279+
10:09:59
1280+
16:28:41
1281+
16:29:10
1282+
16:29:43
1283+
16:30:16
1284+
16:30:49
1285+
16:31:23
1286+
16:31:55
1287+
16:32:28
1288+
16:33:01
1289+
16:33:34
1290+
16:34:07
1291+
16:34:40
1292+
16:35:13
1293+
16:35:46
1294+
16:36:19
1295+
SELECT t FROM t1 WHERE id2=54 AND j=0 AND k=1 GROUP BY t HAVING t=MAX(t);
1296+
t
1297+
10:09:59
1298+
16:28:41
1299+
16:29:10
1300+
16:29:43
1301+
16:30:16
1302+
16:30:49
1303+
16:31:23
1304+
16:31:55
1305+
16:32:28
1306+
16:33:01
1307+
16:33:34
1308+
16:34:07
1309+
16:34:40
1310+
16:35:13
1311+
16:35:46
1312+
16:36:19
1313+
DROP TABLE t1;
1314+
#
12491315
# End of 10.1 tests
12501316
#
12511317
#

mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Verbose run
55
\d |
66
IF (select count(*) from information_schema.global_variables where
7-
variable_name='wsrep_on') = 1 THEN
7+
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
88
ALTER TABLE time_zone ENGINE=InnoDB;
99
ALTER TABLE time_zone_name ENGINE=InnoDB;
1010
ALTER TABLE time_zone_transition ENGINE=InnoDB;
@@ -36,7 +36,7 @@ ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
3636
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
3737
\d |
3838
IF (select count(*) from information_schema.global_variables where
39-
variable_name='wsrep_on') = 1 THEN
39+
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
4040
ALTER TABLE time_zone ENGINE=MyISAM;
4141
ALTER TABLE time_zone_name ENGINE=MyISAM;
4242
ALTER TABLE time_zone_transition ENGINE=MyISAM;
@@ -46,7 +46,7 @@ END IF|
4646
# Silent run
4747
\d |
4848
IF (select count(*) from information_schema.global_variables where
49-
variable_name='wsrep_on') = 1 THEN
49+
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
5050
ALTER TABLE time_zone ENGINE=InnoDB;
5151
ALTER TABLE time_zone_name ENGINE=InnoDB;
5252
ALTER TABLE time_zone_transition ENGINE=InnoDB;
@@ -75,7 +75,7 @@ ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
7575
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
7676
\d |
7777
IF (select count(*) from information_schema.global_variables where
78-
variable_name='wsrep_on') = 1 THEN
78+
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
7979
ALTER TABLE time_zone ENGINE=MyISAM;
8080
ALTER TABLE time_zone_name ENGINE=MyISAM;
8181
ALTER TABLE time_zone_transition ENGINE=MyISAM;
@@ -93,7 +93,7 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset,
9393
;
9494
\d |
9595
IF (select count(*) from information_schema.global_variables where
96-
variable_name='wsrep_on') = 1 THEN
96+
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
9797
ALTER TABLE time_zone ENGINE=MyISAM;
9898
ALTER TABLE time_zone_name ENGINE=MyISAM;
9999
ALTER TABLE time_zone_transition ENGINE=MyISAM;
@@ -105,21 +105,21 @@ END IF|
105105
#
106106
\d |
107107
IF (select count(*) from information_schema.global_variables where
108-
variable_name='wsrep_on') = 1 THEN
108+
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
109109
ALTER TABLE time_zone_leap_second ENGINE=InnoDB;
110110
END IF|
111111
\d ;
112112
TRUNCATE TABLE time_zone_leap_second;
113113
\d |
114114
IF (select count(*) from information_schema.global_variables where
115-
variable_name='wsrep_on') = 1 THEN
115+
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
116116
ALTER TABLE time_zone_leap_second ENGINE=MyISAM;
117117
END IF|
118118
\d ;
119119
ALTER TABLE time_zone_leap_second ORDER BY Transition_time;
120120
\d |
121121
IF (select count(*) from information_schema.global_variables where
122-
variable_name='wsrep_on') = 1 THEN
122+
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
123123
ALTER TABLE time_zone ENGINE=MyISAM;
124124
ALTER TABLE time_zone_name ENGINE=MyISAM;
125125
ALTER TABLE time_zone_transition ENGINE=MyISAM;

0 commit comments

Comments
 (0)