Skip to content

Commit bdf6589

Browse files
committed
Merge 10.6 into 10.11
2 parents 09049fe + 8bd5a3d commit bdf6589

Some content is hidden

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

64 files changed

+1211
-163
lines changed

extra/mariabackup/backup_copy.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,7 @@ ibx_copy_incremental_over_full()
16181618
NULL};
16191619
const char *sup_files[] = {"xtrabackup_binlog_info",
16201620
"xtrabackup_galera_info",
1621+
"donor_galera_info",
16211622
"xtrabackup_slave_info",
16221623
"xtrabackup_info",
16231624
"ib_lru_dump",

extra/mariabackup/backup_copy.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/* special files */
1010
#define XTRABACKUP_SLAVE_INFO "xtrabackup_slave_info"
1111
#define XTRABACKUP_GALERA_INFO "xtrabackup_galera_info"
12+
#define XTRABACKUP_DONOR_GALERA_INFO "donor_galera_info"
1213
#define XTRABACKUP_BINLOG_INFO "xtrabackup_binlog_info"
1314
#define XTRABACKUP_INFO "xtrabackup_info"
1415

extra/mariabackup/backup_mysql.cc

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,6 +1360,7 @@ write_galera_info(ds_ctxt *datasink, MYSQL *connection)
13601360
{
13611361
char *state_uuid = NULL, *state_uuid55 = NULL;
13621362
char *last_committed = NULL, *last_committed55 = NULL;
1363+
char *domain_id = NULL, *domain_id55 = NULL;
13631364
bool result;
13641365

13651366
mysql_variable status[] = {
@@ -1370,6 +1371,12 @@ write_galera_info(ds_ctxt *datasink, MYSQL *connection)
13701371
{NULL, NULL}
13711372
};
13721373

1374+
mysql_variable value[] = {
1375+
{"Wsrep_gtid_domain_id", &domain_id},
1376+
{"wsrep_gtid_domain_id", &domain_id55},
1377+
{NULL, NULL}
1378+
};
1379+
13731380
/* When backup locks are supported by the server, we should skip
13741381
creating xtrabackup_galera_info file on the backup stage, because
13751382
wsrep_local_state_uuid and wsrep_last_committed will be inconsistent
@@ -1388,9 +1395,26 @@ write_galera_info(ds_ctxt *datasink, MYSQL *connection)
13881395
goto cleanup;
13891396
}
13901397

1398+
read_mysql_variables(connection, "SHOW VARIABLES LIKE 'wsrep%'", value, true);
1399+
1400+
if (domain_id == NULL && domain_id55 == NULL) {
1401+
msg("Warning: failed to get master wsrep state from SHOW VARIABLES.");
1402+
result = true;
1403+
goto cleanup;
1404+
}
1405+
13911406
result = datasink->backup_file_printf(XTRABACKUP_GALERA_INFO,
1392-
"%s:%s\n", state_uuid ? state_uuid : state_uuid55,
1393-
last_committed ? last_committed : last_committed55);
1407+
"%s:%s %s\n", state_uuid ? state_uuid : state_uuid55,
1408+
last_committed ? last_committed : last_committed55,
1409+
domain_id ? domain_id : domain_id55);
1410+
1411+
if (result)
1412+
{
1413+
result= datasink->backup_file_printf(XTRABACKUP_DONOR_GALERA_INFO,
1414+
"%s:%s %s\n", state_uuid ? state_uuid : state_uuid55,
1415+
last_committed ? last_committed : last_committed55,
1416+
domain_id ? domain_id : domain_id55);
1417+
}
13941418
if (result)
13951419
{
13961420
write_current_binlog_file(datasink, connection);

extra/mariabackup/wsrep.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ permission notice:
5353

5454
/*! Name of file where Galera info is stored on recovery */
5555
#define XB_GALERA_INFO_FILENAME "xtrabackup_galera_info"
56+
#define XB_GALERA_DONOR_INFO_FILENAME "donor_galera_info"
5657

5758
/***********************************************************************
5859
Store Galera checkpoint info in the 'xtrabackup_galera_info' file, if that
@@ -67,7 +68,7 @@ xb_write_galera_info(bool incremental_prepare)
6768
long long seqno;
6869
MY_STAT statinfo;
6970

70-
/* Do not overwrite existing an existing file to be compatible with
71+
/* Do not overwrite an existing file to be compatible with
7172
servers with older server versions */
7273
if (!incremental_prepare &&
7374
my_stat(XB_GALERA_INFO_FILENAME, &statinfo, MYF(0)) != NULL) {
@@ -101,10 +102,11 @@ xb_write_galera_info(bool incremental_prepare)
101102

102103
seqno = wsrep_xid_seqno(&xid);
103104

104-
msg("mariabackup: Recovered WSREP position: %s:%lld\n",
105-
uuid_str, (long long) seqno);
105+
msg("mariabackup: Recovered WSREP position: %s:%lld domain_id: %lld\n",
106+
uuid_str, (long long) seqno, (long long)wsrep_get_domain_id());
106107

107-
if (fprintf(fp, "%s:%lld", uuid_str, (long long) seqno) < 0) {
108+
if (fprintf(fp, "%s:%lld %lld", uuid_str, (long long) seqno,
109+
(long long)wsrep_get_domain_id()) < 0) {
108110

109111
die(
110112
"could not write to " XB_GALERA_INFO_FILENAME

include/mysql/service_wsrep.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ extern struct wsrep_service_st {
9595
void (*wsrep_thd_kill_LOCK_func)(const MYSQL_THD thd);
9696
void (*wsrep_thd_kill_UNLOCK_func)(const MYSQL_THD thd);
9797
void (*wsrep_thd_set_wsrep_PA_unsafe_func)(MYSQL_THD thd);
98+
uint32 (*wsrep_get_domain_id_func)();
9899
} *wsrep_service;
99100

100101
#define MYSQL_SERVICE_WSREP_INCLUDED
@@ -144,6 +145,7 @@ extern struct wsrep_service_st {
144145
#define wsrep_thd_set_ignored_error(T,V) wsrep_service->wsrep_thd_set_ignored_error_func(T,V)
145146
#define wsrep_report_bf_lock_wait(T,I) wsrep_service->wsrep_report_bf_lock_wait(T,I)
146147
#define wsrep_thd_set_PA_unsafe(T) wsrep_service->wsrep_thd_set_PA_unsafe_func(T)
148+
#define wsrep_get_domain_id(T) wsrep_service->wsrep_get_domain_id_func(T)
147149
#else
148150

149151
#define MYSQL_SERVICE_WSREP_STATIC_INCLUDED
@@ -253,5 +255,6 @@ extern "C" void wsrep_report_bf_lock_wait(const THD *thd,
253255
unsigned long long trx_id);
254256
/* declare parallel applying unsafety for the THD */
255257
extern "C" void wsrep_thd_set_PA_unsafe(MYSQL_THD thd);
258+
extern "C" uint32 wsrep_get_domain_id();
256259
#endif
257260
#endif /* MYSQL_SERVICE_WSREP_INCLUDED */
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[rsync]
2+
wsrep-sst-method=rsync
3+
4+
[mariabackup]
5+
wsrep_sst_method=mariabackup
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# The goal of including this file is to enable galera_sst_method combinations
2+
# (see include/galera_sst_method.combinations)
3+
4+
--source include/have_innodb.inc

mysql-test/main/lowercase_table5.result

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,39 @@ Database Create Database
1111
mysql_TEST CREATE DATABASE `mysql_TEST` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci */
1212
DROP DATABASE mysql_test;
1313
DROP DATABASE mysql_TEST;
14+
#
15+
# Start of 10.4 tests
16+
#
17+
#
18+
# MDEV-33019 The database part is not case sensitive in SP names
19+
#
20+
CREATE DATABASE DB1;
21+
CREATE DATABASE db1;
22+
CREATE PROCEDURE DB1.sp() SELECT 'This is DB1.sp' AS ret;
23+
CREATE PROCEDURE db1.sp() SELECT 'This is db1.sp' AS ret;
24+
CALL DB1.sp();
25+
ret
26+
This is DB1.sp
27+
CALL db1.sp();
28+
ret
29+
This is db1.sp
30+
DROP DATABASE DB1;
31+
CALL DB1.sp();
32+
ERROR 42000: PROCEDURE DB1.sp does not exist
33+
CALL db1.sp();
34+
ret
35+
This is db1.sp
36+
DROP DATABASE db1;
37+
CREATE PROCEDURE SP() SELECT 'This is SP' AS ret;
38+
CREATE PROCEDURE sp() SELECT 'This is sp' AS ret;
39+
ERROR 42000: PROCEDURE sp already exists
40+
CALL SP();
41+
ret
42+
This is SP
43+
CALL sp();
44+
ret
45+
This is SP
46+
DROP PROCEDURE SP;
47+
#
48+
# End of 10.4 tests
49+
#

mysql-test/main/lowercase_table5.test

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,34 @@ DROP DATABASE mysql_test;
1818
DROP DATABASE mysql_TEST;
1919

2020
# End of 10.0 tests
21+
22+
--echo #
23+
--echo # Start of 10.4 tests
24+
--echo #
25+
26+
--echo #
27+
--echo # MDEV-33019 The database part is not case sensitive in SP names
28+
--echo #
29+
30+
CREATE DATABASE DB1;
31+
CREATE DATABASE db1;
32+
CREATE PROCEDURE DB1.sp() SELECT 'This is DB1.sp' AS ret;
33+
CREATE PROCEDURE db1.sp() SELECT 'This is db1.sp' AS ret;
34+
CALL DB1.sp();
35+
CALL db1.sp();
36+
DROP DATABASE DB1;
37+
--error ER_SP_DOES_NOT_EXIST
38+
CALL DB1.sp();
39+
CALL db1.sp();
40+
DROP DATABASE db1;
41+
42+
CREATE PROCEDURE SP() SELECT 'This is SP' AS ret;
43+
--error ER_SP_ALREADY_EXISTS
44+
CREATE PROCEDURE sp() SELECT 'This is sp' AS ret;
45+
CALL SP();
46+
CALL sp();
47+
DROP PROCEDURE SP;
48+
49+
--echo #
50+
--echo # End of 10.4 tests
51+
--echo #

mysql-test/main/subselect4.result

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3239,4 +3239,95 @@ FROM x
32393239
)
32403240
);
32413241
ERROR 21000: Operand should contain 2 column(s)
3242+
#
3243+
# MDEV-29362: Constant subquery used as left part of IN subquery
3244+
#
3245+
CREATE TABLE t1 (a int) ENGINE=MyISAM;
3246+
INSERT INTO t1 VALUES (15), (1), (2);
3247+
CREATE TABLE t2 (b int) ENGINE=MyISAM;
3248+
INSERT INTO t2 VALUES (15), (1);
3249+
CREATE TABLE t3 (c int) ENGINE=MyISAM;
3250+
INSERT INTO t3 VALUES (15), (1);
3251+
SET optimizer_switch='condition_pushdown_from_having=off';
3252+
SELECT a FROM t1 GROUP BY a
3253+
HAVING a = ( (SELECT b FROM t2 where b=1) IN (SELECT c FROM t3) ) + 1;
3254+
a
3255+
2
3256+
SELECT a FROM t1 GROUP BY a
3257+
HAVING a IN ( (SELECT b FROM t2 where b=1) IN (SELECT c FROM t3) );
3258+
a
3259+
1
3260+
SET optimizer_switch='condition_pushdown_from_having=on';
3261+
SELECT a FROM t1 GROUP BY a
3262+
HAVING a = ( (SELECT b FROM t2 where b=1) IN (SELECT c FROM t3) ) + 1;
3263+
a
3264+
2
3265+
SELECT a FROM t1 GROUP BY a
3266+
HAVING a IN ( (SELECT b FROM t2 where b=1) IN (SELECT c FROM t3) );
3267+
a
3268+
1
3269+
EXPLAIN FORMAT=JSON SELECT a FROM t1 GROUP BY a
3270+
HAVING a = ( (SELECT b FROM t2 where b=1) IN (SELECT c FROM t3) ) + 1;
3271+
EXPLAIN
3272+
{
3273+
"query_block": {
3274+
"select_id": 1,
3275+
"nested_loop": [
3276+
{
3277+
"table": {
3278+
"table_name": "t1",
3279+
"access_type": "ALL",
3280+
"rows": 3,
3281+
"filtered": 100,
3282+
"attached_condition": "t1.a = <cache>((<in_optimizer>((subquery#2),<exists>(subquery#3))) + 1)"
3283+
}
3284+
}
3285+
],
3286+
"subqueries": [
3287+
{
3288+
"query_block": {
3289+
"select_id": 3,
3290+
"having_condition": "trigcond(t3.c is null)",
3291+
"nested_loop": [
3292+
{
3293+
"table": {
3294+
"table_name": "t3",
3295+
"access_type": "ALL",
3296+
"rows": 2,
3297+
"filtered": 100,
3298+
"attached_condition": "trigcond(1 = t3.c or t3.c is null)"
3299+
}
3300+
}
3301+
]
3302+
}
3303+
},
3304+
{
3305+
"query_block": {
3306+
"select_id": 2,
3307+
"nested_loop": [
3308+
{
3309+
"table": {
3310+
"table_name": "t2",
3311+
"access_type": "ALL",
3312+
"rows": 2,
3313+
"filtered": 100,
3314+
"attached_condition": "t2.b = 1"
3315+
}
3316+
}
3317+
]
3318+
}
3319+
}
3320+
]
3321+
}
3322+
}
3323+
PREPARE stmt FROM "SELECT a FROM t1 GROUP BY a
3324+
HAVING a = ( (SELECT b FROM t2 where b=1) IN (SELECT c FROM t3) ) + 1";
3325+
EXECUTE stmt;
3326+
a
3327+
2
3328+
EXECUTE stmt;
3329+
a
3330+
2
3331+
DEALLOCATE PREPARE stmt;
3332+
DROP TABLE t1,t2,t3;
32423333
# End of 10.4 tests

0 commit comments

Comments
 (0)