Skip to content

Commit

Permalink
Merge 10.2 into 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Mar 18, 2021
2 parents eb7c553 + c557e95 commit 19052b6
Show file tree
Hide file tree
Showing 244 changed files with 5,161 additions and 6,825 deletions.
13 changes: 4 additions & 9 deletions CREDITS
Expand Up @@ -4,24 +4,19 @@ organization registered in the USA.
The current main sponsors of the MariaDB Foundation are:

Alibaba Cloud https://www.alibabacloud.com/ (2017)
Booking.com https://www.booking.com (2013)
MariaDB Corporation https://www.mariadb.com (2013)
Microsoft https://microsoft.com/ (2017)
ServiceNow https://servicenow.com (2019)
Tencent Cloud https://cloud.tencent.com (2017)
Development Bank of Singapore https://dbs.com (2016)
IBM https://www.ibm.com (2017)
Tencent Games http://game.qq.com/ (2018)
Visma https://visma.com (2015)
Acronis https://acronis.com (2016)
Nexedi https://www.nexedi.com (2016)
Automattic https://automattic.com (2019)
Galera Cluster https://galeracluster.com (2020)
Percona https://www.percona.com (2018)
Tencent Game DBA http://tencentdba.com/about (2016)
Tencent TDSQL http://tdsql.org (2016)
Verkkokauppa.com https://www.verkkokauppa.com (2015)
Virtuozzo https://virtuozzo.com (2016)

For a full list of sponsors, see
https://mariadb.org/about/supporters/
https://mariadb.org/about/#sponsors
and for individual contributors, see
https://mariadb.org/donate/individual-sponsors/

Expand Down
2 changes: 1 addition & 1 deletion cmake/install_macros.cmake
Expand Up @@ -182,7 +182,7 @@ IF(WIN32)
MARK_AS_ADVANCED(SIGNCODE)
IF(SIGNCODE)
SET(SIGNTOOL_PARAMETERS
/a /t http://timestamp.globalsign.com/scripts/timstamp.dll
/a /t http://timestamp.globalsign.com/?signature=sha2
CACHE STRING "parameters for signtool (list)")
FIND_PROGRAM(SIGNTOOL_EXECUTABLE signtool
PATHS "$ENV{ProgramFiles}/Microsoft SDKs/Windows/v7.0A/bin"
Expand Down
3 changes: 0 additions & 3 deletions include/mysql/service_wsrep.h
Expand Up @@ -109,7 +109,6 @@ extern struct wsrep_service_st {
bool (*wsrep_thd_ignore_table_func)(THD *thd);
long long (*wsrep_thd_trx_seqno_func)(THD *thd);
struct wsrep_ws_handle * (*wsrep_thd_ws_handle_func)(THD *thd);
void (*wsrep_thd_auto_increment_variables_func)(THD *thd, unsigned long long *offset, unsigned long long *increment);
void (*wsrep_set_load_multi_commit_func)(THD *thd, bool split);
bool (*wsrep_is_load_multi_commit_func)(THD *thd);
int (*wsrep_trx_is_aborting_func)(MYSQL_THD thd);
Expand Down Expand Up @@ -163,7 +162,6 @@ extern struct wsrep_service_st {
#define wsrep_thd_ignore_table(T) wsrep_service->wsrep_thd_ignore_table_func(T)
#define wsrep_thd_trx_seqno(T) wsrep_service->wsrep_thd_trx_seqno_func(T)
#define wsrep_thd_ws_handle(T) wsrep_service->wsrep_thd_ws_handle_func(T)
#define wsrep_thd_auto_increment_variables(T,O,I) wsrep_service->wsrep_thd_auto_increment_variables_func(T,O,I)
#define wsrep_set_load_multi_commit(T,S) wsrep_service->wsrep_set_load_multi_commit_func(T,S)
#define wsrep_is_load_multi_commit(T) wsrep_service->wsrep_is_load_multi_commit_func(T)
#define wsrep_trx_is_aborting(T) wsrep_service->wsrep_trx_is_aborting_func(T)
Expand Down Expand Up @@ -222,7 +220,6 @@ my_bool wsrep_thd_is_BF(MYSQL_THD thd, my_bool sync);
my_bool wsrep_thd_is_wsrep(MYSQL_THD thd);
struct wsrep *get_wsrep();
struct wsrep_ws_handle *wsrep_thd_ws_handle(THD *thd);
void wsrep_thd_auto_increment_variables(THD *thd, unsigned long long *offset, unsigned long long *increment);
void wsrep_set_load_multi_commit(THD *thd, bool split);
bool wsrep_is_load_multi_commit(THD *thd);
void wsrep_aborting_thd_enqueue(THD *thd);
Expand Down
4 changes: 2 additions & 2 deletions include/service_versions.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2009, 2010, Oracle and/or its affiliates.
Copyright (c) 2012, 2017, MariaDB
Copyright (c) 2012, 2021, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -41,4 +41,4 @@
#define VERSION_thd_specifics 0x0100
#define VERSION_thd_timezone 0x0100
#define VERSION_thd_wait 0x0100
#define VERSION_wsrep 0x0203
#define VERSION_wsrep 0x0301
2 changes: 1 addition & 1 deletion libmariadb
13 changes: 4 additions & 9 deletions mysql-test/main/contributors.result
@@ -1,21 +1,16 @@
SHOW CONTRIBUTORS;
Name Location Comment
Booking.com https://www.booking.com Founding member, Platinum Sponsor of the MariaDB Foundation
Alibaba Cloud https://www.alibabacloud.com/ Platinum Sponsor of the MariaDB Foundation
Tencent Cloud https://cloud.tencent.com Platinum Sponsor of the MariaDB Foundation
Microsoft https://microsoft.com/ Platinum Sponsor of the MariaDB Foundation
MariaDB Corporation https://mariadb.com Founding member, Platinum Sponsor of the MariaDB Foundation
ServiceNow https://servicenow.com Platinum Sponsor of the MariaDB Foundation
Visma https://visma.com Gold Sponsor of the MariaDB Foundation
DBS https://dbs.com Gold Sponsor of the MariaDB Foundation
IBM https://www.ibm.com Gold Sponsor of the MariaDB Foundation
Tencent Games http://game.qq.com/ Gold Sponsor of the MariaDB Foundation
Nexedi https://www.nexedi.com Silver Sponsor of the MariaDB Foundation
Acronis https://www.acronis.com Silver Sponsor of the MariaDB Foundation
Verkkokauppa.com https://www.verkkokauppa.com Bronze Sponsor of the MariaDB Foundation
Virtuozzo https://virtuozzo.com Bronze Sponsor of the MariaDB Foundation
Tencent Game DBA http://tencentdba.com/about Bronze Sponsor of the MariaDB Foundation
Tencent TDSQL http://tdsql.org Bronze Sponsor of the MariaDB Foundation
Percona https://www.percona.com/ Bronze Sponsor of the MariaDB Foundation
Automattic https://automattic.com Silver Sponsor of the MariaDB Foundation
Percona https://www.percona.com/ Sponsor of the MariaDB Foundation
Galera Cluster https://galeracluster.com Sponsor of the MariaDB Foundation
Google USA Sponsoring encryption, parallel replication and GTID
Facebook USA Sponsoring non-blocking API, LIMIT ROWS EXAMINED etc
Ronald Bradford Brisbane, Australia EFF contribution for UC2006 Auction
Expand Down
42 changes: 40 additions & 2 deletions mysql-test/main/cte_nonrecursive.result
Expand Up @@ -618,7 +618,7 @@ with t(c) as (select a from t1 where b >= 'c')
select * from t r1, t r2 where r1.c=r2.c and r2.c=4;
show create view v4;
View Create View character_set_client collation_connection
v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS with t(c) as (select `test`.`t1`.`a` AS `c` from `test`.`t1` where `test`.`t1`.`b` >= 'c')select `r1`.`c` AS `c`,`r2`.`c` AS `d` from (`t` `r1` join (select `test`.`t1`.`a` AS `c` from `test`.`t1` where `test`.`t1`.`b` >= 'c') `r2`) where `r1`.`c` = `r2`.`c` and `r2`.`c` = 4 latin1 latin1_swedish_ci
v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS with t(c) as (select `test`.`t1`.`a` AS `c` from `test`.`t1` where `test`.`t1`.`b` >= 'c')select `r1`.`c` AS `c`,`r2`.`c` AS `d` from (`t` `r1` join `t` `r2`) where `r1`.`c` = `r2`.`c` and `r2`.`c` = 4 latin1 latin1_swedish_ci
select * from v4;
c d
4 4
Expand Down Expand Up @@ -1126,7 +1126,7 @@ NULL UNION RESULT <union2,5> ALL NULL NULL NULL NULL NULL NULL
NULL UNION RESULT <union9,12> ALL NULL NULL NULL NULL NULL NULL
NULL UNION RESULT <union1,6> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1003 with cte_e as (with cte_o as (with cte_i as (/* select#4 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 7)/* select#3 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 1)/* select#2 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1 union /* select#5 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 4 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1)/* select#1 */ select `cte_e1`.`a` AS `a` from `cte_e` `cte_e1` where `cte_e1`.`a` > 1 union /* select#6 */ select `cte_e2`.`a` AS `a` from (with cte_o as (with cte_i as (/* select#11 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 7)/* select#10 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 1)/* select#9 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 union /* select#12 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 4 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7) `cte_e2`
Note 1003 with cte_e as (with cte_o as (with cte_i as (/* select#4 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 7)/* select#3 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 1)/* select#2 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1 union /* select#5 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 4 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1)/* select#1 */ select `cte_e1`.`a` AS `a` from `cte_e` `cte_e1` where `cte_e1`.`a` > 1 union /* select#6 */ select `cte_e2`.`a` AS `a` from `cte_e` `cte_e2`
drop table t1;
#
# MDEV-13753: embedded CTE in a VIEW created in prepared statement
Expand Down Expand Up @@ -1725,6 +1725,44 @@ drop table db1.t1;
drop database db1;
create database test;
use test;
#
# MDEV-24597: CTE with union used multiple times in query
#
with cte(a) as
(select 1 as d union select 2 as d)
select a from cte as r1
union
select a from cte as r2;
a
1
2
create table t1 (a int, b int) engine=myisam;
insert into t1 values
(3,30), (7,70), (1,10), (7,71), (2,20), (7,72), (3,33), (4,44),
(5,50), (4,40), (3,33), (4,42), (4,43), (5,51);
with cte(c) as
(select a from t1 where b < 30 union select a from t1 where b > 40)
select * from cte as r1, cte as r2 where r1.c = r2.c;
c c
1 1
2 2
7 7
4 4
5 5
with cte(a,c) as
(
select a, count(*) from t1 group by a having count(*) = 1
union
select a, count(*) from t1 group by a having count(*) = 3
)
select a, c from cte as r1 where a < 3
union
select a, c from cte as r2 where a > 4;
a c
1 1
2 1
7 3
drop table t1;
# End of 10.2 tests
#
# MDEV-21673: several references to CTE that uses
Expand Down
31 changes: 31 additions & 0 deletions mysql-test/main/cte_nonrecursive.test
Expand Up @@ -1230,6 +1230,37 @@ drop database db1;
create database test;
use test;

--echo #
--echo # MDEV-24597: CTE with union used multiple times in query
--echo #

with cte(a) as
(select 1 as d union select 2 as d)
select a from cte as r1
union
select a from cte as r2;

create table t1 (a int, b int) engine=myisam;
insert into t1 values
(3,30), (7,70), (1,10), (7,71), (2,20), (7,72), (3,33), (4,44),
(5,50), (4,40), (3,33), (4,42), (4,43), (5,51);

with cte(c) as
(select a from t1 where b < 30 union select a from t1 where b > 40)
select * from cte as r1, cte as r2 where r1.c = r2.c;

with cte(a,c) as
(
select a, count(*) from t1 group by a having count(*) = 1
union
select a, count(*) from t1 group by a having count(*) = 3
)
select a, c from cte as r1 where a < 3
union
select a, c from cte as r2 where a > 4;

drop table t1;

--echo # End of 10.2 tests

--echo #
Expand Down
54 changes: 54 additions & 0 deletions mysql-test/main/join_cache.result
Expand Up @@ -6057,6 +6057,59 @@ f2
drop table t1, t2;
set join_buffer_size=@save_join_buffer_size;
#
# MDEV-21104: BNLH used for multi-join query with embedded outer join
# and possible 'not exists' optimization
#
set join_cache_level=4;
CREATE TABLE t1 (a int) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (b int, c int) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,2),(2,4);
CREATE TABLE t3 (d int, KEY(d)) ENGINE=MyISAM;
INSERT INTO t3 VALUES (1),(2);
CREATE TABLE t4 (e int primary key) ENGINE=MyISAM;
INSERT INTO t4 VALUES (1),(2);
ANALYZE TABLE t1,t2,t3,t4;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t2 analyze status OK
test.t3 analyze status OK
test.t4 analyze status OK
SELECT * FROM t2 LEFT JOIN t3 ON c = d;
b c d
1 2 2
2 4 NULL
SELECT * FROM (t2 LEFT JOIN t3 ON c = d ) JOIN t4;
b c d e
1 2 2 1
2 4 NULL 1
1 2 2 2
2 4 NULL 2
EXPLAIN SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t3 hash_index d #hash#d:d 5:5 test.t2.c 2 Using where; Using index; Using join buffer (incremental, BNLH join)
1 SIMPLE t4 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.b 2 Using index; Using join buffer (incremental, BNLH join)
SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e;
a b c d e
1 1 2 2 1
2 1 2 2 1
1 2 4 NULL 2
2 2 4 NULL 2
EXPLAIN SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e
WHERE e IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t3 hash_index d #hash#d:d 5:5 test.t2.c 2 Using where; Using index; Using join buffer (incremental, BNLH join)
1 SIMPLE t4 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.b 2 Using where; Using index; Not exists; Using join buffer (incremental, BNLH join)
SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e
WHERE e IS NULL;
a b c d e
DROP TABLE t1,t2,t3,t4;
set join_cache_level=@save_join_cache_level;
#
# MDEV-21243: Join buffer: condition is checked in wrong place for range access
#
create table t1(a int primary key);
Expand Down Expand Up @@ -6128,4 +6181,5 @@ EXPLAIN
}
}
drop table t1,t2,t3;
# End of 10.3 tests
set @@optimizer_switch=@save_optimizer_switch;
36 changes: 36 additions & 0 deletions mysql-test/main/join_cache.test
Expand Up @@ -4015,6 +4015,41 @@ drop table t1, t2;
set join_buffer_size=@save_join_buffer_size;


--echo #
--echo # MDEV-21104: BNLH used for multi-join query with embedded outer join
--echo # and possible 'not exists' optimization
--echo #

set join_cache_level=4;

CREATE TABLE t1 (a int) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (b int, c int) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,2),(2,4);
CREATE TABLE t3 (d int, KEY(d)) ENGINE=MyISAM;
INSERT INTO t3 VALUES (1),(2);
CREATE TABLE t4 (e int primary key) ENGINE=MyISAM;
INSERT INTO t4 VALUES (1),(2);
ANALYZE TABLE t1,t2,t3,t4;

SELECT * FROM t2 LEFT JOIN t3 ON c = d;
SELECT * FROM (t2 LEFT JOIN t3 ON c = d ) JOIN t4;

let $q1=
SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e;
eval EXPLAIN $q1;
eval $q1;

let $q2=
SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e
WHERE e IS NULL;
eval EXPLAIN $q2;
eval $q2;

DROP TABLE t1,t2,t3,t4;

set join_cache_level=@save_join_cache_level;

--echo #
--echo # MDEV-21243: Join buffer: condition is checked in wrong place for range access
--echo #
Expand Down Expand Up @@ -4054,5 +4089,6 @@ where

drop table t1,t2,t3;

--echo # End of 10.3 tests
# The following command must be the last one in the file
set @@optimizer_switch=@save_optimizer_switch;
10 changes: 9 additions & 1 deletion mysql-test/main/status2.result
Expand Up @@ -74,4 +74,12 @@ DROP TRIGGER trigg1;
DROP FUNCTION testQuestion;
DROP EVENT ev1;
DROP TABLE t1,t2;
End of 6.0 tests
#
# End of 5.5 tests
#
select variable_value < 1024*1024*1024 from information_schema.global_status where variable_name='memory_used';
variable_value < 1024*1024*1024
1
#
# End of 10.2 tests
#
11 changes: 10 additions & 1 deletion mysql-test/main/status2.test
Expand Up @@ -64,5 +64,14 @@ DROP TRIGGER trigg1;
DROP FUNCTION testQuestion;
DROP EVENT ev1;
DROP TABLE t1,t2;
--echo End of 6.0 tests

--echo #
--echo # End of 5.5 tests
--echo #

select variable_value < 1024*1024*1024 from information_schema.global_status where variable_name='memory_used';

--echo #
--echo # End of 10.2 tests
--echo #

38 changes: 38 additions & 0 deletions mysql-test/main/subselect.result
Expand Up @@ -7330,4 +7330,42 @@ WHERE (t2.i, t2.pk) NOT IN ( SELECT t3.i, t3.i FROM t t3, t t4 ) AND t1.c = 'foo
pk i c pk i c
1 10 foo 1 10 foo
DROP TABLE t;
#
# MDEV-25002: Outer reference in ON clause of subselect
#
create table t1 (
pk int primary key,
a int
) engine=myisam;
insert into t1 values (1,1), (2,2);
create table t2 (
pk int primary key,
b int
) engine=myisam;
insert into t2 values (1,1), (2,3);
create table t3 (a int);
insert into t3 values (1),(2);
select a,
(select count(*) from t1, t2
where t2.pk=t3.a and t1.pk=1) as sq
from t3;
a sq
1 1
2 1
select a,
(select count(*) from t1 join t2 on t2.pk=t3.a
where t1.pk=1) as sq
from t3;
a sq
1 1
2 1
select a from t3
where a in (select t2.b from t1,t2 where t2.pk=t3.a and t1.pk=1);
a
1
select a from t3
where a in (select t2.b from t1 join t2 on t2.pk=t3.a where t1.pk=1);
a
1
drop table t1,t2,t3;
# End of 10.2 tests

0 comments on commit 19052b6

Please sign in to comment.