Skip to content

Commit dc1cc5f

Browse files
committed
Merge tag 'clone-5.6.43-build' into mysql-5.6-cluster-7.3
Change-Id: Ia5b5e5eb821099ee108bc3bba7c2d99494a44417
2 parents 7e31c0c + ba2f4d0 commit dc1cc5f

34 files changed

+912
-156
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
MYSQL_VERSION_MAJOR=5
22
MYSQL_VERSION_MINOR=6
3-
MYSQL_VERSION_PATCH=42
3+
MYSQL_VERSION_PATCH=43
44
MYSQL_VERSION_EXTRA=-ndb-7.3.24

client/sql_string.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
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
@@ -26,6 +26,7 @@
2626
#include "sql_string.h"
2727

2828
#include <algorithm>
29+
#include <limits>
2930

3031
using std::min;
3132
using std::max;
@@ -74,6 +75,11 @@ bool String::realloc(uint32 alloc_length, bool force_on_heap)
7475

7576
if (Alloced_length < len)
7677
{
78+
// Signal an error if len exceeds uint32 max on 64-bit word platform.
79+
#if defined(__WORDSIZE) && (__WORDSIZE == 64)
80+
if (len > std::numeric_limits<uint32>::max())
81+
return TRUE;
82+
#endif
7783
char *new_ptr;
7884
if (alloced)
7985
{

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,9 @@ The following options may be given as the first argument:
500500
NULLS_EQUAL (emulate 4.0 behavior), and NULLS_IGNORED
501501
--myisam-use-mmap Use memory mapping for reading and writing MyISAM tables
502502
--named-pipe Enable the named pipe (NT)
503+
--named-pipe-full-access-group=name
504+
Name of Windows group granted full access to the named
505+
pipe
503506
--net-buffer-length=#
504507
Buffer length for TCP/IP and socket communication
505508
--net-read-timeout=#
@@ -1198,6 +1201,7 @@ myisam-sort-buffer-size 8388608
11981201
myisam-stats-method nulls_unequal
11991202
myisam-use-mmap FALSE
12001203
named-pipe FALSE
1204+
named-pipe-full-access-group everyone
12011205
net-buffer-length 16384
12021206
net-read-timeout 30
12031207
net-retry-count 10

mysql-test/suite/binlog/r/binlog_index.result

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,17 @@ master-bin.000020 #
383383
master-bin.000021 #
384384
master-bin.000022 #
385385
DROP TABLE t1;
386+
SET SESSION debug="";
386387
# Test case11: Ends
388+
# Test case12: Bug#25839610 ABORT OCCUR DURING SLAVE BACKUP
389+
# WHEN RELAY LOG INDEX IS LOCK
390+
# This test verifies that serveral retries are performed
391+
# if there is a failure while deleting/renaming index files.
392+
SET SESSION debug="+d,simulate_index_file_delete_failure";
393+
SET SESSION debug="+d,simulate_crash_safe_index_file_rename_failure";
394+
FLUSH LOGS;
395+
include/assert_grep.inc [Retried for delete.]
396+
include/assert_grep.inc [Retried for rename.]
387397
SET SESSION debug="";
398+
# Test case12: Ends
388399
End of tests

mysql-test/suite/binlog/t/binlog_index.test

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,37 @@ SHOW BINARY LOGS;
471471
--source include/restart_mysqld.inc
472472
-- source include/show_binary_logs.inc
473473
DROP TABLE t1;
474+
eval SET SESSION debug="$old";
474475
-- echo # Test case11: Ends
475476

477+
478+
--echo # Test case12: Bug#25839610 ABORT OCCUR DURING SLAVE BACKUP
479+
--echo # WHEN RELAY LOG INDEX IS LOCK
480+
--echo # This test verifies that serveral retries are performed
481+
--echo # if there is a failure while deleting/renaming index files.
482+
483+
--disable_warnings
484+
SET SESSION debug="+d,simulate_index_file_delete_failure";
485+
SET SESSION debug="+d,simulate_crash_safe_index_file_rename_failure";
486+
FLUSH LOGS;
487+
488+
# Check that delete retry is present in the error log
489+
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err
490+
--let $assert_only_after = CURRENT_TEST: binlog.binlog_index
491+
--let $assert_count = 5
492+
--let $assert_select = Retrying delete
493+
--let $assert_text = Retried for delete.
494+
--source include/assert_grep.inc
495+
496+
# Check that rename retry is present in the error log
497+
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err
498+
--let $assert_only_after = CURRENT_TEST: binlog.binlog_index
499+
--let $assert_count = 5
500+
--let $assert_select = Retrying rename
501+
--let $assert_text = Retried for rename.
502+
--source include/assert_grep.inc
503+
--enable_warnings
476504
eval SET SESSION debug="$old";
505+
--echo # Test case12: Ends
506+
477507
--echo End of tests

mysql-test/suite/perfschema/r/dml_setup_instruments.result

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ wait/synch/mutex/sql/LOCK_crypt YES YES
1616
wait/synch/mutex/sql/LOCK_delayed_create YES YES
1717
select * from performance_schema.setup_instruments
1818
where name like 'Wait/Synch/Rwlock/sql/%'
19-
and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock')
19+
and name not in (
20+
'wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock',
21+
'wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group')
2022
order by name limit 10;
2123
NAME ENABLED TIMED
2224
wait/synch/rwlock/sql/Binlog_relay_IO_delegate::lock YES YES

mysql-test/suite/perfschema/t/dml_setup_instruments.test

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@ select * from performance_schema.setup_instruments
2222
order by name limit 10;
2323

2424
# CRYPTO_dynlock_value::lock is dependent on the build (SSL)
25+
# LOCK_named_pipe_full_access_group is dependent on the build (Windows)
2526

2627
select * from performance_schema.setup_instruments
2728
where name like 'Wait/Synch/Rwlock/sql/%'
28-
and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock')
29+
and name not in (
30+
'wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock',
31+
'wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group')
2932
order by name limit 10;
3033

3134
# COND_handler_count is dependent on the build (Windows only)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
include/master-slave.inc
2+
Warnings:
3+
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4+
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
5+
[connection master]
6+
CREATE TABLE t1 (i INT);
7+
include/sync_slave_sql_with_master.inc
8+
include/stop_slave_sql.inc
9+
SET GLOBAL debug='+d,wait_in_purge_index_entry';
10+
FLUSH LOCAL RELAY LOGS;
11+
START SLAVE SQL_THREAD;
12+
SET DEBUG_SYNC="now WAIT_FOR in_purge_index_entry";
13+
[connection master]
14+
INSERT INTO t1 VALUES (1);
15+
[connection slave]
16+
include/assert.inc [IO Thread is waiting for Relay_log_info::log_space_lock.]
17+
SET DEBUG_SYNC="now SIGNAL go_ahead_sql";
18+
[connection master]
19+
DROP TABLE t1;
20+
include/sync_slave_sql_with_master.inc
21+
SET GLOBAL debug='-d,wait_in_purge_index_entry';
22+
SET DEBUG_SYNC="RESET";
23+
include/rpl_end.inc
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# === Purpose ===
2+
#
3+
# This test verifies that SQL and IO threads update the
4+
# rli->relay_log_space_total variable in a synchronized manner.
5+
#
6+
# === Implementation ===
7+
#
8+
# 1. On Slave, make the SQL thread to purge relay logs and halt
9+
# the SQL thread in MYSQL_BIN_LOG::purge_index_entry function
10+
# using debug sync utility.
11+
# 2. Do a DML on master so that IO thread calls queue_event and
12+
# updates rli->relay_log_space_total.
13+
# 3. Verify that IO thread is waiting rli->log_space_lock until it is released
14+
# by SQL thread.
15+
#
16+
# === References ===
17+
#
18+
# Bug#26997096 RELAY_LOG_SPACE IS INACCURATE AND LEAKS
19+
20+
# This test case is binlog_format agnostic
21+
--source include/have_binlog_format_row.inc
22+
# This test case uses debug_sync
23+
--source include/have_debug.inc
24+
--source include/have_debug_sync.inc
25+
--source include/master-slave.inc
26+
27+
CREATE TABLE t1 (i INT);
28+
29+
--source include/sync_slave_sql_with_master.inc
30+
--source include/stop_slave_sql.inc
31+
SET GLOBAL debug='+d,wait_in_purge_index_entry';
32+
33+
# Create a new relay log so the START SLAVE SQL_THREAD tries
34+
# to purge the old relay logs and hits the debug point.
35+
FLUSH LOCAL RELAY LOGS;
36+
START SLAVE SQL_THREAD;
37+
SET DEBUG_SYNC="now WAIT_FOR in_purge_index_entry";
38+
39+
# Do a DML on master so that IO thread calls queue_event and
40+
# updates rli->relay_log_space_total.
41+
--source include/rpl_connection_master.inc
42+
INSERT INTO t1 VALUES (1);
43+
--source include/rpl_connection_slave.inc
44+
45+
# Wait until IO thread tries to take a log_space_lock.
46+
--let $io_thread_id = `SELECT THREAD_ID FROM performance_schema.threads WHERE NAME like '%slave_io%'`
47+
--let $wait_condition= SELECT EVENT_NAME= 'wait/synch/mutex/sql/Relay_log_info::log_space_lock' FROM performance_schema.events_waits_current WHERE THREAD_ID=$io_thread_id
48+
--source include/wait_condition.inc
49+
50+
# Since SQL thread has taken the rli->log_space_lock, IO thread should wait until
51+
# the lock is released. Assert that IO thread is waiting for rli->log_space_lock.
52+
--let $assert_text= IO Thread is waiting for Relay_log_info::log_space_lock.
53+
--let $assert_cond= "[SELECT EVENT_NAME FROM performance_schema.events_waits_current WHERE THREAD_ID=$io_thread_id]" = "wait/synch/mutex/sql/Relay_log_info::log_space_lock"
54+
--source include/assert.inc
55+
56+
SET DEBUG_SYNC="now SIGNAL go_ahead_sql";
57+
58+
# Cleanup
59+
--source include/rpl_connection_master.inc
60+
DROP TABLE t1;
61+
--source include/sync_slave_sql_with_master.inc
62+
SET GLOBAL debug='-d,wait_in_purge_index_entry';
63+
SET DEBUG_SYNC="RESET";
64+
--source include/rpl_end.inc
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
select @@global.named_pipe_full_access_group;
2+
@@global.named_pipe_full_access_group
3+
everyone
4+
select @@session.named_pipe_full_access_group;
5+
ERROR HY000: Variable 'named_pipe_full_access_group' is a GLOBAL variable
6+
show global variables like 'named_pipe_full_access_group';
7+
Variable_name Value
8+
named_pipe_full_access_group everyone
9+
show session variables like 'named_pipe_full_access_group';
10+
Variable_name Value
11+
named_pipe_full_access_group everyone
12+
select * from information_schema.global_variables where variable_name='named_pipe_full_access_group';
13+
VARIABLE_NAME VARIABLE_VALUE
14+
NAMED_PIPE_FULL_ACCESS_GROUP everyone
15+
select * from information_schema.session_variables where variable_name='named_pipe_full_access_group';
16+
VARIABLE_NAME VARIABLE_VALUE
17+
NAMED_PIPE_FULL_ACCESS_GROUP everyone

0 commit comments

Comments
 (0)