Skip to content

Commit aeefd26

Browse files
committed
Merge branch '10.0' into 10.1
2 parents 50c9469 + 802ce96 commit aeefd26

30 files changed

+284
-104
lines changed

cmake/zlib.cmake

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ ENDMACRO()
3434

3535
MACRO (MYSQL_CHECK_ZLIB_WITH_COMPRESS)
3636

37-
# For NDBCLUSTER: Use bundled zlib by default
38-
IF (NOT WITH_ZLIB)
39-
SET(WITH_ZLIB "bundled" CACHE STRING "By default use bundled zlib on this platform")
40-
ENDIF()
41-
4237
IF(WITH_ZLIB STREQUAL "bundled")
4338
MYSQL_USE_BUNDLED_ZLIB()
4439
ELSE()

mysql-test/r/func_group_innodb.result

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,4 +246,34 @@ EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b;
246246
id select_type table type possible_keys key key_len ref rows Extra
247247
1 SIMPLE t1 range NULL b 263 NULL 3 Using index for group-by
248248
DROP TABLE t1;
249+
#
250+
# MDEV-17589: Stack-buffer-overflow with indexed varchar (utf8) field
251+
#
252+
set @save_innodb_file_format= @@innodb_file_format;
253+
set @save_innodb_large_prefix= @@innodb_large_prefix;
254+
set global innodb_file_format = BARRACUDA;
255+
set global innodb_large_prefix = ON;
256+
CREATE TABLE t1 (v1 varchar(1020), v2 varchar(2), v3 varchar(2),
257+
KEY k1 (v3,v2,v1)) ENGINE=InnoDB CHARACTER SET=utf8 ROW_FORMAT=DYNAMIC;
258+
INSERT INTO t1 VALUES ('king', 'qu','qu'), ('bad','go','go');
259+
explain
260+
SELECT MIN(t1.v1) FROM t1 where t1.v2='qu' and t1.v3='qu';
261+
id select_type table type possible_keys key key_len ref rows Extra
262+
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
263+
SELECT MIN(t1.v1) FROM t1 where t1.v2='qu' and t1.v3='qu';
264+
MIN(t1.v1)
265+
king
266+
drop table t1;
267+
CREATE TABLE t1 (v1 varchar(1024) CHARACTER SET utf8, KEY v1 (v1)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
268+
INSERT INTO t1 VALUES ('king'), ('bad');
269+
explain
270+
SELECT MIN(x.v1) FROM (SELECT t1.* FROM t1 WHERE t1.v1 >= 'p') x;
271+
id select_type table type possible_keys key key_len ref rows Extra
272+
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row
273+
SELECT MIN(x.v1) FROM (SELECT t1.* FROM t1 WHERE t1.v1 >= 'p') x;
274+
MIN(x.v1)
275+
NULL
276+
drop table t1;
277+
set global innodb_file_format = @save_innodb_file_format;
278+
set global innodb_large_prefix = @save_innodb_large_prefix;
249279
End of 5.5 tests

mysql-test/r/innodb_ext_key.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,7 @@ from
10891089
t0 A, t0 B, t0 C;
10901090
drop table t0,t1;
10911091
#
1092+
#
10921093
# MDEV-10360: Extended keys: index properties depend on index order
10931094
#
10941095
create table t0 (a int);

mysql-test/r/range_innodb.result

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,21 @@ id select_type table type possible_keys key key_len ref rows Extra
3737
1 SIMPLE t0 ALL NULL NULL NULL NULL 10
3838
1 SIMPLE t2 range a,b b 5 NULL 201 Using where; Using join buffer (flat, BNL join)
3939
drop table t0,t1,t2;
40+
CREATE TABLE t1 (
41+
pk INT PRIMARY KEY, f1 INT, f2 CHAR(1), f3 CHAR(1),
42+
KEY(f1), KEY(f2)
43+
) ENGINE=InnoDB;
44+
INSERT INTO t1 VALUES
45+
(1,4,'v',NULL),(2,6,'v',NULL),(3,7,'c',NULL),(4,1,'e',NULL),(5,0,'x',NULL),
46+
(6,7,'i',NULL),(7,7,'e',NULL),(8,1,'p',NULL),(9,7,'s',NULL),(10,1,'j',NULL),
47+
(11,5,'z',NULL),(12,2,'c',NULL),(13,0,'a',NULL),(14,1,'q',NULL),(15,8,'y',NULL),
48+
(16,1,'m',NULL),(17,1,'r',NULL),(18,9,'v',NULL),(19,1,'n',NULL);
49+
CREATE TABLE t2 (f4 INT, f5 CHAR(1)) ENGINE=InnoDB;
50+
INSERT INTO t2 VALUES (4,'q'),(NULL,'j');
51+
SELECT * FROM t1 AS t1_1, t1 AS t1_2, t2
52+
WHERE f5 = t1_2.f2 AND ( t1_1.f1 = 103 AND t1_1.f2 = 'o' OR t1_1.pk < f4 );
53+
pk f1 f2 f3 pk f1 f2 f3 f4 f5
54+
1 4 v NULL 14 1 q NULL 4 q
55+
2 6 v NULL 14 1 q NULL 4 q
56+
3 7 c NULL 14 1 q NULL 4 q
57+
drop table t1,t2;

mysql-test/r/read_only.result

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,24 @@ flush privileges;
168168
drop database mysqltest_db1;
169169
set global read_only= @start_read_only;
170170
#
171+
# MDEV-16987 - ALTER DATABASE possible in read-only mode
172+
#
173+
CREATE USER user1@localhost;
174+
GRANT ALTER ON test1.* TO user1@localhost;
175+
CREATE DATABASE test1;
176+
SET GLOBAL read_only=1;
177+
ALTER DATABASE test1 CHARACTER SET utf8;
178+
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
179+
SET GLOBAL read_only=0;
180+
DROP DATABASE test1;
181+
DROP USER user1@localhost;
182+
USE test;
183+
# End of 5.5 tests
184+
#
171185
# WL#5968 Implement START TRANSACTION READ (WRITE|ONLY);
172186
#
173187
#
174188
# Test interaction with read_only system variable.
175-
DROP TABLE IF EXISTS t1;
176189
CREATE TABLE t1(a INT);
177190
INSERT INTO t1 VALUES (1), (2);
178191
CREATE USER user1;
@@ -204,3 +217,4 @@ COMMIT;
204217
DROP USER user1;
205218
SET GLOBAL read_only= 0;
206219
DROP TABLE t1;
220+
# End of 10.0 tests

mysql-test/suite/innodb/r/innodb-alter.result

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,27 @@ WHERE T.NAME='test/t1';
865865
NAME
866866
a
867867
DROP TABLE t1;
868+
# and an MDEV-18041 regression related to indexes prefixes
869+
create table `test` (
870+
`test_old` varchar(255) NOT NULL,
871+
`other` varchar(255) NOT NULL,
872+
PRIMARY KEY (`test_old`,`other`),
873+
UNIQUE KEY uk (`test_old`(100), `other`)
874+
) ENGINE=InnoDB;
875+
select name, pos from information_schema.innodb_SYS_FIELDS where name in ('test_old', 'other', 'test_new');
876+
name pos
877+
test_old 0
878+
other 1
879+
test_old 0
880+
other 1
881+
alter table `test` CHANGE COLUMN `test_old` `test_new` varchar(255) NOT NULL;
882+
select name, pos from information_schema.innodb_SYS_FIELDS where name in ('test_old', 'other', 'test_new');
883+
name pos
884+
test_new 0
885+
other 1
886+
test_new 0
887+
other 1
888+
drop table `test`;
868889
#
869890
# BUG 20029625 - HANDLE_FATAL_SIGNAL (SIG=11) IN
870891
# DICT_MEM_TABLE_COL_RENAME_LOW

mysql-test/suite/innodb/t/innodb-alter.test

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,19 @@ SELECT C.NAME FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS C INNER JOIN
522522
WHERE T.NAME='test/t1';
523523
DROP TABLE t1;
524524

525+
--echo # and an MDEV-18041 regression related to indexes prefixes
526+
create table `test` (
527+
`test_old` varchar(255) NOT NULL,
528+
`other` varchar(255) NOT NULL,
529+
PRIMARY KEY (`test_old`,`other`),
530+
UNIQUE KEY uk (`test_old`(100), `other`)
531+
) ENGINE=InnoDB;
532+
533+
select name, pos from information_schema.innodb_SYS_FIELDS where name in ('test_old', 'other', 'test_new');
534+
alter table `test` CHANGE COLUMN `test_old` `test_new` varchar(255) NOT NULL;
535+
select name, pos from information_schema.innodb_SYS_FIELDS where name in ('test_old', 'other', 'test_new');
536+
drop table `test`;
537+
525538

526539
--echo #
527540
--echo # BUG 20029625 - HANDLE_FATAL_SIGNAL (SIG=11) IN

mysql-test/suite/rpl/r/rpl_idempotency.result

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ a
6767
-3
6868
1
6969
include/check_slave_no_error.inc
70+
drop table t1, t2;
7071
DROP TABLE t1, t2;
72+
include/check_slave_no_error.inc
73+
create database d;
74+
create database e;
75+
create database d;
76+
create database if not exists e;
77+
include/check_slave_no_error.inc
78+
drop database d;
79+
drop database e;
80+
drop database d;
81+
drop database if exists e;
82+
include/check_slave_no_error.inc
7183
SET @@global.slave_exec_mode= @old_slave_exec_mode;
7284
include/rpl_end.inc

mysql-test/suite/rpl/t/rpl_idempotency.test

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,30 @@ SELECT * FROM t1 ORDER BY a;
7575
SELECT * FROM t2 ORDER BY a;
7676
--source include/check_slave_no_error.inc
7777

78+
connection slave;
79+
drop table t1, t2;
80+
7881
connection master;
7982
DROP TABLE t1, t2;
8083
sync_slave_with_master;
84+
--source include/check_slave_no_error.inc
85+
create database d;
86+
create database e;
87+
88+
connection master;
89+
create database d;
90+
create database if not exists e;
91+
92+
sync_slave_with_master;
93+
--source include/check_slave_no_error.inc
94+
drop database d;
95+
drop database e;
96+
97+
connection master;
98+
drop database d;
99+
drop database if exists e;
100+
sync_slave_with_master;
101+
--source include/check_slave_no_error.inc
81102

82103
SET @@global.slave_exec_mode= @old_slave_exec_mode;
83104

mysql-test/t/func_group_innodb.test

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,30 @@ EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b;
192192

193193
DROP TABLE t1;
194194

195+
--echo #
196+
--echo # MDEV-17589: Stack-buffer-overflow with indexed varchar (utf8) field
197+
--echo #
198+
199+
set @save_innodb_file_format= @@innodb_file_format;
200+
set @save_innodb_large_prefix= @@innodb_large_prefix;
201+
set global innodb_file_format = BARRACUDA;
202+
set global innodb_large_prefix = ON;
203+
204+
CREATE TABLE t1 (v1 varchar(1020), v2 varchar(2), v3 varchar(2),
205+
KEY k1 (v3,v2,v1)) ENGINE=InnoDB CHARACTER SET=utf8 ROW_FORMAT=DYNAMIC;
206+
INSERT INTO t1 VALUES ('king', 'qu','qu'), ('bad','go','go');
207+
explain
208+
SELECT MIN(t1.v1) FROM t1 where t1.v2='qu' and t1.v3='qu';
209+
SELECT MIN(t1.v1) FROM t1 where t1.v2='qu' and t1.v3='qu';
210+
drop table t1;
211+
212+
CREATE TABLE t1 (v1 varchar(1024) CHARACTER SET utf8, KEY v1 (v1)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
213+
INSERT INTO t1 VALUES ('king'), ('bad');
214+
explain
215+
SELECT MIN(x.v1) FROM (SELECT t1.* FROM t1 WHERE t1.v1 >= 'p') x;
216+
SELECT MIN(x.v1) FROM (SELECT t1.* FROM t1 WHERE t1.v1 >= 'p') x;
217+
drop table t1;
218+
set global innodb_file_format = @save_innodb_file_format;
219+
set global innodb_large_prefix = @save_innodb_large_prefix;
220+
195221
--echo End of 5.5 tests

0 commit comments

Comments
 (0)