Skip to content

Commit 587568b

Browse files
committed
Merge branch '5.5' into 10.0
2 parents bcb36ee + 51c415d commit 587568b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+421
-58
lines changed

include/mysql_com.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
2-
Copyright (c) 2010, 2013, Monty Program Ab
2+
Copyright (c) 2010, 2018, MariaDB
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by

include/sql_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef SQL_COMMON_INCLUDED
22
#define SQL_COMMON_INCLUDED
33
/* Copyright (c) 2003, 2012, Oracle and/or its affiliates.
4-
Copyright (c) 2010, 2012, Monty Program Ab
4+
Copyright (c) 2010, 2018, MariaDB
55
66
This program is free software; you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by

mysql-test/mysql-test-run.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- cperl -*-
33

44
# Copyright (c) 2004, 2014, Oracle and/or its affiliates.
5-
# Copyright (c) 2009, 2017, MariaDB Corporation
5+
# Copyright (c) 2009, 2018, MariaDB Corporation
66
#
77
# This program is free software; you can redistribute it and/or modify
88
# it under the terms of the GNU General Public License as published by

mysql-test/r/ctype_ucs.result

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4590,6 +4590,37 @@ Field Type Null Key Default Extra
45904590
c1 mediumtext YES NULL
45914591
DROP TABLE t1;
45924592
#
4593+
# MDEV-15624 Changing the default character set to utf8mb4 changes query evaluation in a very surprising way
4594+
#
4595+
SET NAMES utf8;
4596+
CREATE TABLE t1 (id INT);
4597+
INSERT INTO t1 VALUES (1),(2),(3);
4598+
SELECT COUNT(DISTINCT c) FROM (SELECT id, REPLACE(uuid_short(), '0', CAST('o' AS CHAR CHARACTER SET ucs2)) AS c FROM t1) AS d1;
4599+
COUNT(DISTINCT c)
4600+
3
4601+
SELECT DISTINCT REPLACE(uuid_short(), '0', CAST('o' AS CHAR CHARACTER SET ucs2)) AS c FROM t1;
4602+
c
4603+
xxxxxxxxxxxxxxxxx
4604+
xxxxxxxxxxxxxxxxx
4605+
xxxxxxxxxxxxxxxxx
4606+
SELECT COUNT(DISTINCT c) FROM (SELECT id, INSERT(uuid_short(), 1, 1, CAST('0' AS CHAR CHARACTER SET ucs2)) AS c FROM t1) AS d1;
4607+
COUNT(DISTINCT c)
4608+
3
4609+
SELECT DISTINCT INSERT(uuid_short(), 1, 1, CAST('0' AS CHAR CHARACTER SET ucs2)) AS c FROM t1;
4610+
c
4611+
xxxxxxxxxxxxxxxxx
4612+
xxxxxxxxxxxxxxxxx
4613+
xxxxxxxxxxxxxxxxx
4614+
SELECT COUNT(DISTINCT c) FROM (SELECT id, CONCAT(uuid_short(), CAST('0' AS CHAR CHARACTER SET ucs2)) AS c FROM t1) AS d1;
4615+
COUNT(DISTINCT c)
4616+
3
4617+
SELECT DISTINCT CONCAT(uuid_short(), CAST('0' AS CHAR CHARACTER SET ucs2)) AS c FROM t1;
4618+
c
4619+
xxxxxxxxxxxxxxxxx
4620+
xxxxxxxxxxxxxxxxx
4621+
xxxxxxxxxxxxxxxxx
4622+
DROP TABLE t1;
4623+
#
45934624
# End of 5.5 tests
45944625
#
45954626
#

mysql-test/r/ctype_utf8mb4.result

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2859,6 +2859,29 @@ SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 65536) AS data ) AS sub;
28592859
len
28602860
196608
28612861
#
2862+
# MDEV-15624 Changing the default character set to utf8mb4 changes query evaluation in a very surprising way
2863+
#
2864+
SET NAMES utf8mb4;
2865+
CREATE TABLE t1 (id INT);
2866+
INSERT INTO t1 VALUES (1),(2),(3);
2867+
SELECT COUNT(DISTINCT c) FROM (SELECT id, REPLACE(UUID(), "-", "") AS c FROM t1) AS d1;
2868+
COUNT(DISTINCT c)
2869+
3
2870+
SELECT DISTINCT INSERT(uuid(), 9, 1, "X") AS c FROM t1;
2871+
c
2872+
xxxxxxxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
2873+
xxxxxxxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
2874+
xxxxxxxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
2875+
SELECT COUNT(DISTINCT c) FROM (SELECT id, INSERT(UUID(), 9, 1, "X") AS c FROM t1) AS d1;
2876+
COUNT(DISTINCT c)
2877+
3
2878+
SELECT DISTINCT INSERT(UUID(), 9, 1, "X") AS c FROM t1;
2879+
c
2880+
xxxxxxxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
2881+
xxxxxxxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
2882+
xxxxxxxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
2883+
DROP TABLE t1;
2884+
#
28622885
# End of 5.5 tests
28632886
#
28642887
#

mysql-test/r/mysqld--help.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
The following options may be given as the first argument:
22
--print-defaults Print the program argument list and exit.
33
--no-defaults Don't read default options from any option file.
4+
The following specify which files/extra groups are read (specified before remaining options):
45
--defaults-file=# Only read default options from the given file #.
56
--defaults-extra-file=# Read this file after the global files are read.
7+
--defaults-group-suffix=# Additionally read default groups with # appended as a suffix.
68

79
--allow-suspicious-udfs
810
Allows use of UDFs consisting of only one symbol xxx()

mysql-test/r/read_only_innodb.result

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,14 @@ a a
221221
5 10
222222
DROP TABLE temp1, temp2;
223223

224+
# MDEV-14185 CREATE TEMPORARY TABLE AS SELECT causes error 1290 with read_only and InnoDB.
225+
226+
CREATE TEMPORARY TABLE temp1 ENGINE=INNODB AS SELECT a FROM t1;
227+
SELECT * FROM temp1;
228+
a
229+
1
230+
DROP TABLE temp1;
231+
224232
# Disconnect and cleanup
225233

226234
SET GLOBAL READ_ONLY = OFF;

mysql-test/r/sp-destruct.result

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,9 @@ create database mysqltest1;
174174
create procedure mysqltest1.foo() select "foo";
175175
update mysql.proc set name='' where db='mysqltest1';
176176
drop database mysqltest1;
177+
create procedure p1() set @foo = 10;
178+
alter table mysql.proc drop primary key;
179+
drop procedure p1;
180+
ERROR HY000: Cannot load from mysql.proc. The table is probably corrupted
181+
alter table mysql.proc add primary key (db,name,type);
182+
drop procedure p1;

mysql-test/r/subselect4.result

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ EXPLAIN
10431043
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2 WHERE f3 > 10);
10441044
id select_type table type possible_keys key key_len ref rows Extra
10451045
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
1046-
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No matching min/max row
1046+
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
10471047
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2 WHERE f3 > 10);
10481048
f1 f2
10491049
SET @@optimizer_switch = 'materialization=off,in_to_exists=on,semijoin=off';
@@ -1134,7 +1134,7 @@ EXPLAIN
11341134
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2 WHERE f3 > 10);
11351135
id select_type table type possible_keys key key_len ref rows Extra
11361136
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
1137-
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No matching min/max row
1137+
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
11381138
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2 WHERE f3 > 10);
11391139
f1 f2
11401140
set @@optimizer_switch=@save_optimizer_switch;
@@ -2498,3 +2498,23 @@ SELECT 2 IN (SELECT 2 from DUAL WHERE 1 != 1);
24982498
0
24992499
SET optimizer_switch= @@global.optimizer_switch;
25002500
set @@tmp_table_size= @@global.tmp_table_size;
2501+
#
2502+
# mfrv-14515: Wrong results for tableless query with subquery in WHERE
2503+
# and implicit aggregation
2504+
#
2505+
create table t1 (i1 int, i2 int);
2506+
insert into t1 values (1314, 1084),(1330, 1084),(1401, 1084),(580, 1084);
2507+
create table t2 (cd int);
2508+
insert into t2 values
2509+
(1330), (1330), (1330), (1330), (1330), (1330), (1330), (1330),
2510+
(1330), (1330), (1330), (1330), (1330), (1330), (1330), (1330);
2511+
select max(10) from dual
2512+
where exists (select 1 from t2 join t1 on t1.i1 = t2.cd and t1.i2 = 345);
2513+
max(10)
2514+
NULL
2515+
insert into t2 select * from t2;
2516+
select max(10) from dual
2517+
where exists (select 1 from t2 join t1 on t1.i1 = t2.cd and t1.i2 = 345);
2518+
max(10)
2519+
NULL
2520+
DROP TABLE t1,t2;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
create table t1 (a int not null, b int not null) engine=innodb;
2+
insert t1 values (1,2),(3,4);
3+
lock table t1 write, t1 tr read;
4+
flush status;
5+
alter table t1 add primary key (b);
6+
show status like 'Handler_read_rnd_next';
7+
Variable_name Value
8+
Handler_read_rnd_next 0
9+
unlock tables;
10+
alter table t1 drop primary key;
11+
lock table t1 write;
12+
flush status;
13+
alter table t1 add primary key (b);
14+
show status like 'Handler_read_rnd_next';
15+
Variable_name Value
16+
Handler_read_rnd_next 0
17+
unlock tables;
18+
alter table t1 drop primary key;
19+
flush status;
20+
alter table t1 add primary key (b);
21+
show status like 'Handler_read_rnd_next';
22+
Variable_name Value
23+
Handler_read_rnd_next 0
24+
drop table t1;

0 commit comments

Comments
 (0)