Skip to content

Commit c7a2f23

Browse files
author
Alexander Barkov
committed
Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3
2 parents b4a2baf + b12430a commit c7a2f23

Some content is hidden

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

56 files changed

+639
-357
lines changed

BUILD/SETUP.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,3 +308,5 @@ gprof_compile_flags="-O2 -pg -g"
308308
gprof_link_flags="--disable-shared $static_link"
309309

310310
disable_gprof_plugins="--with-zlib-dir=bundled --without-plugin-oqgraph --without-plugin-mroonga"
311+
312+
disable_asan_plugins="--without-plugin-rocksdb"

BUILD/compile-pentium64-asan-max

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ path=`dirname $0`
1818
. "$path/SETUP.sh"
1919

2020
extra_flags="$pentium64_cflags $debug_cflags -lasan -O -g -fsanitize=address"
21-
extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs"
21+
extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs $disable_asan_plugins"
2222
export LDFLAGS="-ldl"
2323

2424
. "$path/FINISH.sh"

cmake/build_configurations/mysql_release.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ IF(FEATURE_SET)
6262
SET(WITH_NONE ON)
6363
ENDIF()
6464

65-
IF(num GREATER FEATURE_SET_xsmall)
65+
IF(num GREATER FEATURE_SET_xsmall AND NOT WIN32)
6666
SET(WITH_EMBEDDED_SERVER ON CACHE BOOL "")
6767
ENDIF()
6868
IF(num GREATER FEATURE_SET_small)
@@ -88,7 +88,9 @@ ENDIF()
8888
OPTION(ENABLED_LOCAL_INFILE "" ON)
8989
SET(WITH_INNODB_SNAPPY OFF CACHE STRING "")
9090
IF(WIN32)
91-
SET(WITH_LIBARCHIVE STATIC CACHE STRING "")
91+
SET(INSTALL_MYSQLTESTDIR "" CACHE STRING "")
92+
SET(INSTALL_SQLBENCHDIR "" CACHE STRING "")
93+
SET(INSTALL_SUPPORTFILESDIR "" CACHE STRING "")
9294
ELSEIF(RPM)
9395
SET(WITH_SSL system CACHE STRING "")
9496
SET(WITH_ZLIB system CACHE STRING "")

cmake/os/Windows.cmake

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,10 @@ IF(MSVC)
8686
# Enable debug info also in Release build,
8787
# and create PDB to be able to analyze crashes.
8888
FOREACH(type EXE SHARED MODULE)
89-
SET(CMAKE_{type}_LINKER_FLAGS_RELEASE
89+
SET(CMAKE_${type}_LINKER_FLAGS_RELEASE
9090
"${CMAKE_${type}_LINKER_FLAGS_RELEASE} /debug")
91+
SET(CMAKE_${type}_LINKER_FLAGS_MINSIZEREL
92+
"${CMAKE_${type}_LINKER_FLAGS_MINSIZEREL} /debug")
9193
ENDFOREACH()
9294

9395
# Force static runtime libraries
@@ -108,10 +110,15 @@ IF(MSVC)
108110
CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO
109111
CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG_INIT
110112
CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO
111-
CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG_INIT)
113+
CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG_INIT
114+
CMAKE_C_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_MINSIZEREL
115+
)
112116
STRING(REGEX REPLACE "/M[TD][d]?" "${MSVC_CRT_TYPE}" "${flag}" "${${flag}}" )
113117
STRING(REGEX REPLACE "/D[ ]?_DEBUG" "" "${flag}" "${${flag}}")
114118
STRING(REPLACE "/Zi" "/Z7" "${flag}" "${${flag}}")
119+
IF(NOT "${${flag}}" MATCHES "/Z7")
120+
STRING(APPEND ${flag} " /Z7")
121+
ENDIF()
115122
ENDFOREACH()
116123

117124

@@ -139,9 +146,12 @@ IF(MSVC)
139146
ENDIF()
140147

141148
#TODO: update the code and remove the disabled warnings
142-
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805 /wd4996 /we4700 /we4311 /we4477 /we4302 /we4090 /wd4267 ")
143-
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /wd4291 /wd4577 /we4099 /we4700 /we4311 /we4477 /we4302 /we4090 /wd4267")
144-
149+
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4805 /wd4996 /we4700 /we4311 /we4477 /we4302 /we4090")
150+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4805 /wd4291 /wd4996 /we4099 /we4700 /we4311 /we4477 /we4302 /we4090")
151+
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
152+
# Temporarily disable size_t warnings, due to their amount
153+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267")
154+
ENDIF()
145155
IF(MYSQL_MAINTAINER_MODE MATCHES "ERR")
146156
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
147157
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")

include/my_valgrind.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
3333
#endif /* HAVE_VALGRIND_MEMCHECK_H */
3434

35-
#ifndef DBUG_OFF
35+
#if !defined(DBUG_OFF) || defined(TRASH_FREED_MEMORY)
3636
#define TRASH_FILL(A,B,C) do { const size_t trash_tmp= (B); memset(A, C, trash_tmp); MEM_UNDEFINED(A, trash_tmp); } while (0)
3737
#else
3838
#define TRASH_FILL(A,B,C) do{ const size_t trash_tmp __attribute__((unused)) = (B) ; MEM_CHECK_ADDRESSABLE(A,trash_tmp);MEM_UNDEFINED(A,trash_tmp);} while (0)

libmariadb

mysql-test/lib/My/SafeProcess/CMakeLists.txt

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,16 @@
1313
# along with this program; if not, write to the Free Software
1414
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1515

16-
IF (NOT INSTALL_MYSQLTESTDIR)
16+
17+
IF (WIN32)
18+
ADD_EXECUTABLE(my_safe_process safe_process_win.cc)
19+
ADD_EXECUTABLE(my_safe_kill safe_kill_win.cc)
20+
TARGET_LINK_LIBRARIES(my_safe_kill dbghelp psapi)
21+
ELSE()
22+
ADD_EXECUTABLE(my_safe_process safe_process.cc)
23+
ENDIF()
24+
25+
IF(NOT INSTALL_MYSQLTESTDIR)
1726
RETURN()
1827
ENDIF()
1928

@@ -22,14 +31,9 @@ SET(INSTALL_ARGS
2231
COMPONENT Test
2332
)
2433

34+
INSTALL(TARGETS my_safe_process ${INSTALL_ARGS})
2535
IF (WIN32)
26-
MYSQL_ADD_EXECUTABLE(my_safe_process safe_process_win.cc ${INSTALL_ARGS})
27-
MYSQL_ADD_EXECUTABLE(my_safe_kill safe_kill_win.cc ${INSTALL_ARGS})
28-
TARGET_LINK_LIBRARIES(my_safe_kill dbghelp psapi)
29-
ELSE()
30-
MYSQL_ADD_EXECUTABLE(my_safe_process safe_process.cc ${INSTALL_ARGS})
36+
INSTALL(TARGETS my_safe_kill ${INSTALL_ARGS})
3137
ENDIF()
3238

33-
INSTALL(FILES Base.pm
34-
DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test
35-
)
39+
INSTALL(FILES Base.pm ${INSTALL_ARGS})

mysql-test/r/sp.result

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8186,6 +8186,34 @@ END
81868186
CALL p1();
81878187
DROP PROCEDURE p1;
81888188
#
8189+
# MDEV-15057 Crash when using an unknown identifier as an SP parameter
8190+
#
8191+
CREATE OR REPLACE PROCEDURE p1 (a VARCHAR(10)) SELECT 1;
8192+
CALL p1(a);
8193+
ERROR 42S22: Unknown column 'a' in 'field list'
8194+
drop procedure p1;
8195+
CREATE OR REPLACE PROCEDURE p1 (a VARCHAR(10)) SELECT a|
8196+
CREATE OR REPLACE PROCEDURE p2 ()
8197+
BEGIN
8198+
DECLARE name VARCHAR(10);
8199+
SET name="hello";
8200+
call p1(name);
8201+
END|
8202+
CREATE OR REPLACE PROCEDURE p3 ()
8203+
BEGIN
8204+
DECLARE name VARCHAR(10);
8205+
SET name="hello";
8206+
call p1(name2);
8207+
END|
8208+
call p2();
8209+
a
8210+
hello
8211+
call p3();
8212+
ERROR 42S22: Unknown column 'name2' in 'field list'
8213+
drop procedure p1;
8214+
drop procedure p2;
8215+
drop procedure p3;
8216+
#
81898217
# Start of 10.3 tests
81908218
#
81918219
#
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
include/master-slave.inc
2+
[connection master]
3+
connection master;
4+
call mtr.add_suppression("Timeout waiting for reply of binlog");
5+
SET @@GLOBAL.rpl_semi_sync_master_enabled = 1;
6+
SET @@GLOBAL.rpl_semi_sync_master_timeout=100;
7+
connection slave;
8+
include/stop_slave.inc
9+
SET @@GLOBAL.replicate_events_marked_for_skip=FILTER_ON_MASTER;
10+
SET @@GLOBAL. rpl_semi_sync_slave_enabled = 1;
11+
include/start_slave.inc
12+
connection master;
13+
CREATE TABLE t1 (a INT) ENGINE=innodb;
14+
SET @@GLOBAL.debug_dbug= "d,dbug_master_binlog_over_2GB";
15+
SET @@SESSION.skip_replication=1;
16+
INSERT INTO t1 SET a=1;
17+
SET @@SESSION.skip_replication=0;
18+
INSERT INTO t1 SET a=0;
19+
connection slave;
20+
connection master;
21+
SET @@GLOBAL.debug_dbug="";
22+
SET @@GLOBAL. rpl_semi_sync_master_timeout = 10000;
23+
SET @@GLOBAL. rpl_semi_sync_master_enabled = 0;
24+
connection master;
25+
DROP TABLE t1;
26+
connection slave;
27+
include/stop_slave.inc
28+
SET @@GLOBAL. rpl_semi_sync_slave_enabled = 0;
29+
SET @@GLOBAL.replicate_events_marked_for_skip = REPLICATE;
30+
include/rpl_end.inc
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# MDEV-14721 Big transaction events get lost on semisync master when
2+
# replicate_events_marked_for_skip=FILTER_ON_MASTER
3+
#
4+
# When events of a big transaction are binlogged offsetting over 2GB from
5+
# the beginning of the log the semisync master's dump thread
6+
# lost such events.
7+
# The test verifies the fixes' correctness simulating the 2GB offset.
8+
9+
source include/have_semisync.inc;
10+
source include/not_embedded.inc;
11+
source include/have_innodb.inc;
12+
source include/have_debug.inc;
13+
source include/master-slave.inc;
14+
15+
--connection master
16+
# Suppress warnings that might be generated during the test
17+
call mtr.add_suppression("Timeout waiting for reply of binlog");
18+
19+
--let $sav_enabled_master=`SELECT @@GLOBAL.rpl_semi_sync_master_enabled `
20+
--let $sav_timeout_master=`SELECT @@GLOBAL.rpl_semi_sync_master_timeout `
21+
SET @@GLOBAL.rpl_semi_sync_master_enabled = 1;
22+
SET @@GLOBAL.rpl_semi_sync_master_timeout=100;
23+
24+
--connection slave
25+
source include/stop_slave.inc;
26+
--let $sav_skip_marked_slave=`SELECT @@GLOBAL.replicate_events_marked_for_skip `
27+
SET @@GLOBAL.replicate_events_marked_for_skip=FILTER_ON_MASTER;
28+
--let $sav_enabled_slave=`SELECT @@GLOBAL.rpl_semi_sync_slave_enabled `
29+
SET @@GLOBAL. rpl_semi_sync_slave_enabled = 1;
30+
31+
source include/start_slave.inc;
32+
33+
--connection master
34+
CREATE TABLE t1 (a INT) ENGINE=innodb;
35+
36+
# Make the following events as if they offset over 2GB from the beginning of binlog
37+
SET @@GLOBAL.debug_dbug= "d,dbug_master_binlog_over_2GB";
38+
SET @@SESSION.skip_replication=1;
39+
INSERT INTO t1 SET a=1;
40+
SET @@SESSION.skip_replication=0;
41+
INSERT INTO t1 SET a=0;
42+
43+
--sync_slave_with_master
44+
45+
#
46+
# Clean up
47+
#
48+
--connection master
49+
SET @@GLOBAL.debug_dbug="";
50+
--eval SET @@GLOBAL. rpl_semi_sync_master_timeout = $sav_timeout_master
51+
--eval SET @@GLOBAL. rpl_semi_sync_master_enabled = $sav_enabled_master
52+
53+
--connection master
54+
DROP TABLE t1;
55+
56+
--sync_slave_with_master
57+
source include/stop_slave.inc;
58+
--eval SET @@GLOBAL. rpl_semi_sync_slave_enabled = $sav_enabled_slave
59+
--eval SET @@GLOBAL.replicate_events_marked_for_skip = $sav_skip_marked_slave
60+
61+
--let $rpl_only_running_threads= 1
62+
--source include/rpl_end.inc

0 commit comments

Comments
 (0)