Skip to content

Commit c1f3eff

Browse files
committed
Merge branch '10.5' into 10.6
2 parents 52f6df9 + 267dd5a commit c1f3eff

34 files changed

+348
-64
lines changed

CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,6 @@ IF(SECURITY_HARDENED AND NOT WITH_ASAN AND NOT WITH_UBSAN AND NOT WITH_TSAN AND
264264
MY_CHECK_AND_SET_COMPILER_FLAG("-D_FORTIFY_SOURCE=2" RELEASE RELWITHDEBINFO)
265265
ENDIF()
266266

267-
INCLUDE(wsrep)
268-
269267
OPTION(WITH_DBUG_TRACE "Enable DBUG_ENTER()/DBUG_RETURN()/DBUG_PRINT()" ON)
270268
IF(WITH_DBUG_TRACE)
271269
FOREACH(LANG C CXX)
@@ -276,7 +274,12 @@ ENDIF()
276274
# Always enable debug sync for debug builds.
277275
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
278276
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
279-
277+
278+
IF(CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10")
279+
# Enable extra checks when using a recent enough version of GNU libstdc++
280+
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG -D_GLIBCXX_ASSERTIONS")
281+
ENDIF()
282+
280283
OPTION(ENABLE_GCOV "Enable gcov (debug, Linux builds only)" OFF)
281284
IF (ENABLE_GCOV)
282285
MY_CHECK_AND_SET_COMPILER_FLAG("-DHAVE_gcov -fprofile-arcs -ftest-coverage -lgcov" DEBUG)
@@ -337,6 +340,8 @@ ELSEIF(TRASH_FREED_MEMORY MATCHES "AUTO" AND NOT WIN32 AND NOT WITH_VALGRIND AND
337340
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DTRASH_FREED_MEMORY")
338341
ENDIF()
339342

343+
INCLUDE(wsrep)
344+
340345
# Set commonly used variables
341346
IF(WIN32)
342347
SET(DEFAULT_MYSQL_HOME "C:/Program Files/MariaDB ${MYSQL_BASE_VERSION}")

client/mysqlbinlog.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3024,7 +3024,8 @@ int main(int argc, char** argv)
30243024
{
30253025
if (!opt_version)
30263026
{
3027-
usage();
3027+
error("Please provide the log file(s). Run with '--help' for usage "
3028+
"instructions.");
30283029
retval= ERROR_STOP;
30293030
}
30303031
goto err;

client/mysqldump.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3068,8 +3068,9 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
30683068
}
30693069
else
30703070
dynstr_set_checked(&select_field_names, "");
3071-
insert_option= ((delayed && opt_ignore) ? " DELAYED IGNORE " :
3072-
delayed ? " DELAYED " : opt_ignore ? " IGNORE " : "");
3071+
3072+
insert_option= ((delayed && opt_ignore) ? "DELAYED IGNORE " :
3073+
delayed ? "DELAYED " : opt_ignore ? "IGNORE " : "");
30733074

30743075
verbose_msg("-- Retrieving table structure for table %s...\n", table);
30753076

cmake/pcre.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ MACRO(BUNDLE_PCRE2)
4949
SET(pcre2_flags${v} "${pcre2_flags${v}} -std=c99 ")
5050
IF(MSVC)
5151
# Suppress a warning
52-
STRING(APPEND pcre2_flags${v} " /wd4244 " )
52+
STRING(APPEND pcre2_flags${v} " /wd4244 /wd4267 " )
5353
# Disable asan support
54-
STRING(REPLACE "-fsanitize=address" "" pcre2_flags${v} "${CMAKE_C_FLAGS${v}}")
54+
STRING(REPLACE "-fsanitize=address" "" pcre2_flags${v} "${pcre2_flags${v}}")
5555
ENDIF()
5656
ENDFOREACH()
5757
ExternalProject_Add(
5858
pcre2
5959
PREFIX "${dir}"
60-
URL "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.42/pcre2-10.42.zip"
61-
URL_MD5 fe90992fbfb03f854bd9f344074f49eb
60+
URL "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.43/pcre2-10.43.zip"
61+
URL_MD5 b58f050f2fdd6f2ca5774a2975377a85
6262
INSTALL_COMMAND ""
6363
CMAKE_ARGS
6464
"-DCMAKE_WARN_DEPRECATED=FALSE"

cmake/zlib.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ MACRO (MYSQL_CHECK_ZLIB_WITH_COMPRESS)
3737
IF(WITH_ZLIB STREQUAL "bundled")
3838
MYSQL_USE_BUNDLED_ZLIB()
3939
ELSE()
40-
INCLUDE(FindZLIB)
40+
FIND_PACKAGE(PkgConfig QUIET)
41+
IF(PKG_CONFIG_FOUND AND (COMMAND PKG_GET_VARIABLE) AND (NOT WIN32))
42+
PKG_GET_VARIABLE(ZLIB_ROOT zlib prefix)
43+
ENDIF()
44+
FIND_PACKAGE(ZLIB)
4145
IF(ZLIB_FOUND)
4246
INCLUDE(CheckFunctionExists)
43-
SET(CMAKE_REQUIRED_LIBRARIES z)
47+
SET(CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES})
4448
CHECK_FUNCTION_EXISTS(crc32 HAVE_CRC32)
4549
CHECK_FUNCTION_EXISTS(compressBound HAVE_COMPRESSBOUND)
4650
CHECK_FUNCTION_EXISTS(deflateBound HAVE_DEFLATEBOUND)

mysql-test/include/have_innodb.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
# will be skipped unless innodb is enabled
44
#
55
--disable_query_log
6+
if (`select version() like '%debug%'`)
7+
{
8+
SET STATEMENT sql_log_bin=0 FOR
9+
call mtr.add_suppression("InnoDB: Trying to delete tablespace.*pending operations");
10+
}
611
if (`select count(*) from information_schema.system_variables where variable_name='have_sanitizer' and global_value like 'MSAN%'`)
712
{
813
SET STATEMENT sql_log_bin=0 FOR

mysql-test/main/func_hybrid_type.result

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4313,5 +4313,30 @@ ERROR HY000: Illegal parameter data types bigint unsigned and row for operation
43134313
SELECT @@max_allowed_packet=ROW(1,1);
43144314
ERROR HY000: Illegal parameter data types bigint unsigned and row for operation '='
43154315
#
4316+
# MDEV-21034 GREATEST() and LEAST() malfunction for NULL
4317+
#
4318+
SELECT 5 AS c1 FROM dual WHERE GREATEST(1, NULL);
4319+
c1
4320+
SELECT 5 AS c1 FROM dual WHERE LEAST(1, NULL);
4321+
c1
4322+
CREATE TABLE t0 (c0 INT);
4323+
INSERT INTO t0 VALUES (1);
4324+
SELECT * FROM t0 WHERE GREATEST(c0, NULL);
4325+
c0
4326+
SELECT * FROM t0 WHERE LEAST(c0, NULL);
4327+
c0
4328+
DROP TABLE t0;
4329+
SELECT 5 AS c1 FROM dual WHERE GREATEST(1e0, NULL);
4330+
c1
4331+
SELECT 5 AS c1 FROM dual WHERE LEAST(1e0, NULL);
4332+
c1
4333+
CREATE TABLE t0 (c0 DOUBLE);
4334+
INSERT INTO t0 VALUES (1);
4335+
SELECT * FROM t0 WHERE GREATEST(c0, NULL);
4336+
c0
4337+
SELECT * FROM t0 WHERE LEAST(c0, NULL);
4338+
c0
4339+
DROP TABLE t0;
4340+
#
43164341
# End of 10.5 tests
43174342
#

mysql-test/main/func_hybrid_type.test

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,29 @@ SELECT 0x20+ROW(1,1);
11151115
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
11161116
SELECT @@max_allowed_packet=ROW(1,1);
11171117

1118+
--echo #
1119+
--echo # MDEV-21034 GREATEST() and LEAST() malfunction for NULL
1120+
--echo #
1121+
1122+
SELECT 5 AS c1 FROM dual WHERE GREATEST(1, NULL);
1123+
SELECT 5 AS c1 FROM dual WHERE LEAST(1, NULL);
1124+
1125+
CREATE TABLE t0 (c0 INT);
1126+
INSERT INTO t0 VALUES (1);
1127+
SELECT * FROM t0 WHERE GREATEST(c0, NULL);
1128+
SELECT * FROM t0 WHERE LEAST(c0, NULL);
1129+
DROP TABLE t0;
1130+
1131+
SELECT 5 AS c1 FROM dual WHERE GREATEST(1e0, NULL);
1132+
SELECT 5 AS c1 FROM dual WHERE LEAST(1e0, NULL);
1133+
1134+
CREATE TABLE t0 (c0 DOUBLE);
1135+
INSERT INTO t0 VALUES (1);
1136+
SELECT * FROM t0 WHERE GREATEST(c0, NULL);
1137+
SELECT * FROM t0 WHERE LEAST(c0, NULL);
1138+
DROP TABLE t0;
1139+
1140+
11181141
--echo #
11191142
--echo # End of 10.5 tests
11201143
--echo #

mysql-test/main/func_math.result

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3617,5 +3617,20 @@ SELECT CRC32(ExtractValue('<a><b/></a>', '/a/b')) AS f;
36173617
f
36183618
0
36193619
#
3620+
# MDEV-33534 UBSAN: Negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself in my_double_round from sql/item_func.cc|
3621+
#
3622+
SELECT TRUNCATE(EXP(-1.e-2),-1.e+30) AS c1;
3623+
c1
3624+
0
3625+
SELECT (TRUNCATE(EXP(-1.e-2),-1.e+30) % RADIANS(-1)) AS c1;
3626+
c1
3627+
0
3628+
SELECT (TRUNCATE(EXP(-1.e-2),-1.e+30) % RADIANS(-1)) * (LAST_DAY('1-03-30 1:29:12') MOD 1 + COS(-1)) AS c1;
3629+
c1
3630+
0
3631+
SELECT(ASIN(-1)+ LN(-1)) % (ATAN(-1) MOD FLOOR(1)) * (TRUNCATE(EXP(-1.e-2),-1.e+30) % RADIANS(-1)) * (LAST_DAY('1-03-30 1:29:12') MOD 1 + COS(-1)) AS c1;
3632+
c1
3633+
NULL
3634+
#
36203635
# End of 10.5 tests
36213636
#

mysql-test/main/func_math.test

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,6 +1929,16 @@ DROP TABLE t2, t1;
19291929
SELECT CRC32(ExtractValue('<a><b/></a>', '/a/b')) AS f;
19301930

19311931

1932+
--echo #
1933+
--echo # MDEV-33534 UBSAN: Negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself in my_double_round from sql/item_func.cc|
1934+
--echo #
1935+
1936+
SELECT TRUNCATE(EXP(-1.e-2),-1.e+30) AS c1;
1937+
SELECT (TRUNCATE(EXP(-1.e-2),-1.e+30) % RADIANS(-1)) AS c1;
1938+
SELECT (TRUNCATE(EXP(-1.e-2),-1.e+30) % RADIANS(-1)) * (LAST_DAY('1-03-30 1:29:12') MOD 1 + COS(-1)) AS c1;
1939+
SELECT(ASIN(-1)+ LN(-1)) % (ATAN(-1) MOD FLOOR(1)) * (TRUNCATE(EXP(-1.e-2),-1.e+30) % RADIANS(-1)) * (LAST_DAY('1-03-30 1:29:12') MOD 1 + COS(-1)) AS c1;
1940+
1941+
19321942
--echo #
19331943
--echo # End of 10.5 tests
19341944
--echo #

0 commit comments

Comments
 (0)