Skip to content

Commit 7f19007

Browse files
committed
Merge branch '10.1' into 10.2
2 parents 375caf9 + b54aeeb commit 7f19007

File tree

1,859 files changed

+171959
-108982
lines changed

Some content is hidden

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

1,859 files changed

+171959
-108982
lines changed

client/mysqlbinlog.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2952,10 +2952,11 @@ int main(int argc, char** argv)
29522952

29532953
if (!argc || opt_version)
29542954
{
2955-
if (!argc)
2956-
usage();
29572955
if (!opt_version)
2956+
{
2957+
usage();
29582958
retval= ERROR_STOP;
2959+
}
29592960
goto err;
29602961
}
29612962

cmake/wsrep.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ENDIF()
2626
OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ${with_wsrep_default})
2727

2828
# Set the patch version
29-
SET(WSREP_PATCH_VERSION "20")
29+
SET(WSREP_PATCH_VERSION "21")
3030

3131
# Obtain wsrep API version
3232
FILE(STRINGS "${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h" WSREP_API_VERSION

extra/mariabackup/write_filt.cc

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
2727
#include "write_filt.h"
2828
#include "fil_cur.h"
2929
#include "xtrabackup.h"
30+
#include <os0proc.h>
3031

3132
/************************************************************************
3233
Write-through page write filter. */
@@ -67,19 +68,22 @@ wf_incremental_init(xb_write_filt_ctxt_t *ctxt, char *dst_name,
6768
xb_fil_cur_t *cursor)
6869
{
6970
char meta_name[FN_REFLEN];
70-
ulint buf_size;
7171
xb_wf_incremental_ctxt_t *cp =
7272
&(ctxt->u.wf_incremental_ctxt);
7373

7474
ctxt->cursor = cursor;
7575

7676
/* allocate buffer for incremental backup (4096 pages) */
77-
buf_size = (cursor->page_size.physical() / 4 + 1)
78-
* cursor->page_size.physical();
79-
cp->delta_buf_base = static_cast<byte *>(malloc(buf_size));
80-
memset(cp->delta_buf_base, 0, buf_size);
81-
cp->delta_buf = static_cast<byte *>
82-
(ut_align(cp->delta_buf_base, cursor->page_size.physical()));
77+
cp->delta_buf_size = (cursor->page_size.physical() / 4)
78+
* cursor->page_size.physical();
79+
cp->delta_buf = (unsigned char *)os_mem_alloc_large(&cp->delta_buf_size);
80+
81+
if (!cp->delta_buf) {
82+
msg("[%02u] mariabackup: Error: "
83+
"cannot allocate %zu bytes\n",
84+
cursor->thread_n, (size_t) cp->delta_buf_size);
85+
return (FALSE);
86+
}
8387

8488
/* write delta meta info */
8589
snprintf(meta_name, sizeof(meta_name), "%s%s", dst_name,
@@ -183,8 +187,7 @@ static void
183187
wf_incremental_deinit(xb_write_filt_ctxt_t *ctxt)
184188
{
185189
xb_wf_incremental_ctxt_t *cp = &(ctxt->u.wf_incremental_ctxt);
186-
187-
free(cp->delta_buf_base);
190+
os_mem_free_large(cp->delta_buf, cp->delta_buf_size);
188191
}
189192

190193
/************************************************************************

extra/mariabackup/write_filt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
3030

3131
/* Incremental page filter context */
3232
typedef struct {
33-
byte *delta_buf_base;
33+
ulint delta_buf_size;
3434
byte *delta_buf;
3535
ulint npages;
3636
} xb_wf_incremental_ctxt_t;

mysql-test/include/have_debug.inc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,3 @@
22
# suite.pm will make sure that all tests including this file
33
# will be skipped unless this is a debug build.
44
#
5-
# The test below is redundant
6-
7-
if (`select version() not like '%debug%'`) {
8-
--skip Needs a debug build
9-
}
Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
11
#
2-
# Check if server has support for loading plugins
2+
# suite.pm will make sure that all tests including this file
3+
# will be skipped unless dynamic ha_example plugin is available
34
#
4-
if (`SELECT @@have_dynamic_loading != 'YES'`) {
5-
--skip Example plugin requires dynamic loading
6-
}
7-
8-
#
9-
# Check if the variable EXAMPLE_PLUGIN is set
10-
#
11-
if (!$HA_EXAMPLE_SO) {
12-
--skip Need example plugin
13-
}
14-

mysql-test/include/have_innodb.inc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,3 @@
22
# suite.pm will make sure that all tests including this file
33
# will be skipped unless innodb or xtradb is enabled
44
#
5-
# The test below is redundant
6-
7-
if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'innodb' AND support IN ('YES', 'DEFAULT', 'ENABLED')`)
8-
{
9-
--skip Test requires InnoDB.
10-
}

mysql-test/include/have_xtradb.inc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,3 @@
22
# suite.pm will make sure that all tests including this file
33
# will be skipped unless xtradb is enabled
44
#
5-
# The test below is redundant
6-
7-
if (!`SELECT count(*) FROM information_schema.plugins WHERE
8-
plugin_name = 'innodb' AND plugin_status = 'active' AND
9-
plugin_description LIKE '%xtradb%'`){
10-
skip Needs XtraDB engine;
11-
}

mysql-test/include/not_embedded.inc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,3 @@
22
# suite.pm will make sure that all tests including this file
33
# will be skipped unless this is an embedded test run
44
#
5-
# The test below is redundant
6-
7-
if (`select version() like '%embedded%'`) {
8-
This should never happen;
9-
}
10-

mysql-test/include/not_windows.inc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
--require r/not_windows.require
2-
disable_query_log;
3-
select convert(@@version_compile_os using latin1) NOT IN ("Win32","Win64","Windows") as "TRUE";
4-
enable_query_log;
1+
#
2+
# suite.pm will make sure that all tests including this file
3+
# will be skipped unless this is on Windows
4+
#

mysql-test/include/show_gtid_list.inc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# ==== Purpose ====
2+
#
3+
# Extract Gtid_list info from SHOW BINLOG EVENTS output masking
4+
# non-deterministic fields.
5+
#
6+
# ==== Usage ====
7+
#
8+
# [--let $binlog_file=filename
9+
#
10+
if ($binlog_file)
11+
{
12+
--let $_in_binlog_file=in '$binlog_file'
13+
}
14+
--replace_column 2 # 5 #
15+
--eval show binlog events $_in_binlog_file limit 1,1

mysql-test/r/mysqlbinlog.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,3 +1258,4 @@ DELIMITER ;
12581258
ROLLBACK /* added by mysqlbinlog */;
12591259
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
12601260
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
1261+
mysqlbinlog Ver VER for OS at ARCH

mysql-test/r/not_windows.require

Lines changed: 0 additions & 2 deletions
This file was deleted.

mysql-test/r/sp.result

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8115,6 +8115,18 @@ CALL p();
81158115
drop procedure p;
81168116
drop view v;
81178117
drop table t, tmp_t;
8118+
#
8119+
# MDEV-13936: Server crashes in Time_and_counter_tracker::incr_loops
8120+
#
8121+
CREATE TABLE t1 (i INT);
8122+
CREATE VIEW v1 AS SELECT * FROM t1 WHERE RAND() > 0.5;
8123+
CREATE FUNCTION f1() RETURNS INT RETURN ( SELECT MAX(i) FROM v1 );
8124+
REPLACE INTO v1 VALUES (f1());
8125+
ERROR HY000: The target table v1 of the INSERT is not insertable-into
8126+
SET @aux = f1();
8127+
DROP FUNCTION f1;
8128+
DROP VIEW v1;
8129+
DROP TABLE t1;
81188130
#End of 10.1 tests
81198131
#
81208132
# MDEV-11081: CURSOR for query with GROUP BY

mysql-test/r/trigger.result

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2329,6 +2329,23 @@ DROP TRIGGER t1_bi;
23292329
DROP TABLE t1;
23302330
SET TIMESTAMP=DEFAULT;
23312331
set time_zone= @@global.time_zone;
2332+
#
2333+
# MDEV-13936: Server crashes in Time_and_counter_tracker::incr_loops
2334+
#
2335+
CREATE TABLE t1 (i INT);
2336+
CREATE VIEW v1 AS SELECT * FROM t1 WHERE RAND() > 0.5;
2337+
CREATE TABLE t2 (a int);
2338+
CREATE TABLE t3 (a int);
2339+
create trigger trg after insert on t2 for each row
2340+
INSERT INTO t3 SELECT MAX(i) FROM v1 UNION SELECT MAX(i) FROM v1;
2341+
drop table t1;
2342+
insert into t2 value (2);
2343+
ERROR 42S02: Table 'test.t1' doesn't exist
2344+
CREATE TABLE t1 (i INT);
2345+
insert into t2 value (2);
2346+
DROP VIEW v1;
2347+
DROP TABLE t1,t2,t3;
2348+
End of 10.1 tests.
23322349
create table t1 (i int);
23332350
create trigger tr1 after insert on t1 for each row set @a=@a+1;
23342351
create trigger tr2 after insert on t1 for each row set @a=@a+1;
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
RESET MASTER;
2+
FLUSH BINARY LOGS DELETE_DOMAIN_ID = ();
3+
and the command execution is effective thence rotates binlog as usual
4+
show binary logs;
5+
Log_name File_size
6+
master-bin.000001 #
7+
master-bin.000002 #
8+
Non-existed domain is warned, the command completes without rotation
9+
but with a warning
10+
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (99);
11+
Warnings:
12+
Warning 1076 The gtid domain being deleted ('99') is not in the current binlog state
13+
show binary logs;
14+
Log_name File_size
15+
master-bin.000001 #
16+
master-bin.000002 #
17+
SET @@SESSION.gtid_domain_id=1;
18+
SET @@SESSION.server_id=1;
19+
CREATE TABLE t (a int);
20+
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
21+
ERROR HY000: Could not delete gtid domain. Reason: binlog files may contain gtids from the domain ('1') being deleted. Make sure to first purge those files.
22+
FLUSH BINARY LOGS;
23+
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
24+
ERROR HY000: Could not delete gtid domain. Reason: binlog files may contain gtids from the domain ('1') being deleted. Make sure to first purge those files.
25+
PURGE BINARY LOGS TO 'master-bin.000003';;
26+
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
27+
Gtid_list of the current binlog does not contain '1':
28+
show binlog events in 'master-bin.000004' limit 1,1;
29+
Log_name Pos Event_type Server_id End_log_pos Info
30+
master-bin.000004 # Gtid_list 1 # []
31+
But the previous log's Gtid_list may have it which explains a warning from the following command
32+
show binlog events in 'master-bin.000003' limit 1,1;
33+
Log_name Pos Event_type Server_id End_log_pos Info
34+
master-bin.000003 # Gtid_list 1 # [1-1-1]
35+
Already deleted domain in Gtid_list of the earliest log is benign
36+
but may cause a warning
37+
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
38+
Warnings:
39+
Warning 1076 The current gtid binlog state is incompatible with a former one missing gtids from the '1-1' domain-server pair which is referred to in the gtid list describing an earlier state. Ignore if the domain ('1') was already explicitly deleted.
40+
Warning 1076 The gtid domain being deleted ('1') is not in the current binlog state
41+
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 0);
42+
ERROR HY000: Could not delete gtid domain. Reason: binlog files may contain gtids from the domain ('1') being deleted. Make sure to first purge those files.
43+
FLUSH BINARY LOGS;
44+
PURGE BINARY LOGS TO 'master-bin.000005';
45+
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 0);
46+
Warnings:
47+
Warning 1076 The gtid domain being deleted ('0') is not in the current binlog state
48+
Gtid_list of the current binlog does not contain 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 0:
49+
show binlog events in 'master-bin.000006' limit 1,1;
50+
Log_name Pos Event_type Server_id End_log_pos Info
51+
master-bin.000006 # Gtid_list 1 # []
52+
SET @@SESSION.gtid_domain_id=1;;
53+
SET @@SESSION.server_id=1;
54+
SET @@SESSION.gtid_seq_no=1;
55+
INSERT INTO t SET a=1;
56+
SET @@SESSION.server_id=2;
57+
SET @@SESSION.gtid_seq_no=2;
58+
INSERT INTO t SET a=2;
59+
SET @@SESSION.gtid_domain_id=11;
60+
SET @@SESSION.server_id=11;
61+
SET @@SESSION.gtid_seq_no=11;
62+
INSERT INTO t SET a=11;
63+
SET @gtid_binlog_state_saved=@@GLOBAL.gtid_binlog_state;
64+
FLUSH BINARY LOGS;
65+
SET @@SESSION.gtid_domain_id=11;
66+
SET @@SESSION.server_id=11;
67+
SET @@SESSION.gtid_seq_no=1;
68+
INSERT INTO t SET a=1;
69+
SELECT @gtid_binlog_state_saved "as original state", @@GLOBAL.gtid_binlog_state as "out of order for 11 domain state";
70+
as original state out of order for 11 domain state
71+
1-1-1,1-2-2,11-11-11 1-1-1,1-2-2,11-11-1
72+
PURGE BINARY LOGS TO 'master-bin.000007';
73+
the following command succeeds with warnings
74+
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
75+
Warnings:
76+
Warning 1076 The current gtid binlog state is incompatible with a former one having a gtid '11-11-1' which is less than the '11-11-11' of the gtid list describing an earlier state. The state may have been affected by manually injecting a lower sequence number gtid or via replication.
77+
DROP TABLE t;
78+
RESET MASTER;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
SET @@SESSION.debug_dbug='+d,inject_binlog_delete_domain_init_error';
2+
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (99);
3+
ERROR HY000: Could not delete gtid domain. Reason: injected error.
4+
SHOW WARNINGS;
5+
Level Code Message
6+
Error 1076 Could not delete gtid domain. Reason: injected error.

0 commit comments

Comments
 (0)