Skip to content

Commit 28d6530

Browse files
committed
Merge branch '10.6' into 10.11
2 parents e7aaf29 + 643319a commit 28d6530

Some content is hidden

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

51 files changed

+534
-74
lines changed

cmake/maintainer.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@ SET(MY_WARNING_FLAGS
4141
-Wvla
4242
-Wwrite-strings
4343
-Wcast-function-type-strict
44-
-Wframe-larger-than=16384
4544
)
4645

46+
IF(NOT (WITH_MSAN OR WITH_ASAN OR WITH_UBSAN))
47+
SET(MY_WARNING_FLAGS ${MY_WARNING_FLAGS} -Wframe-larger-than=16384)
48+
ENDIF()
49+
4750
# Warning flags that are in testing before moving
4851
# to MY_WARNING_FLAGS if stable.
4952
SET(MY_WARNING_FLAGS_NON_FATAL

extra/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ IF(WITH_INNOBASE_STORAGE_ENGINE)
8282
)
8383

8484

85+
# clang ~16+ with return values being undefined is resolved by basic optimization
86+
# compiler flags for the function mach_read_from_2 (per MDEV-36316)
87+
IF(WITH_MSAN AND CMAKE_BUILD_TYPE STREQUAL "Debug")
88+
SET_SOURCE_FILES_PROPERTIES(
89+
${INNOBASE_SOURCES}
90+
innochecksum.cc
91+
PROPERTIES COMPILE_FLAGS -Og)
92+
ENDIF()
8593
MYSQL_ADD_EXECUTABLE(innochecksum innochecksum.cc ${INNOBASE_SOURCES})
8694
TARGET_LINK_LIBRARIES(innochecksum mysys mysys_ssl)
8795
ADD_DEPENDENCIES(innochecksum GenError)

include/my_attribute.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,22 @@ _Pragma("GCC diagnostic ignored \"-Wframe-larger-than=\"")
9191
#define PRAGMA_REENABLE_CHECK_STACK_FRAME \
9292
_Pragma("GCC diagnostic pop")
9393

94+
/*
95+
The following check is for older gcc version that allocates
96+
a lot of stack during startup that does not need to be checked
97+
*/
98+
99+
#if !defined(__clang__) && __GNUC__ < 13
100+
#define PRAGMA_DISABLE_CHECK_STACK_FRAME_EXTRA PRAGMA_DISABLE_CHECK_STACK_FRAME
94101
#else
102+
#define PRAGMA_DISABLE_CHECK_STACK_FRAME_EXTRA
103+
#endif /* !defined(__clang__) && __GNUC__ < 13 */
104+
105+
#else /*! __GNUC__ */
95106
#define PRAGMA_DISABLE_CHECK_STACK_FRAME
96107
#define PRAGMA_REENABLE_CHECK_STACK_FRAME
97-
#endif
108+
#define PRAGMA_DISABLE_CHECK_STACK_FRAME
109+
#define PRAGMA_DISABLE_CHECK_STACK_FRAME_EXTRA
110+
#endif /* __GNUC__ */
98111

99112
#endif /* _my_attribute_h */

include/my_pthread.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,17 @@ extern void my_mutex_end(void);
668668
We need to have at least 256K stack to handle calls to myisamchk_init()
669669
with the current number of keys and key parts.
670670
*/
671-
# if defined(__SANITIZE_ADDRESS__) || defined(WITH_UBSAN)
671+
#if !defined(__has_feature)
672+
#define __has_feature(x) 0
673+
#endif
674+
#if defined(__clang__) && __has_feature(memory_sanitizer) && !defined(DBUG_OFF)
675+
/*
676+
MSAN in Debug with clang-20.1 required more memory to complete
677+
mtr begin/end checks. The result without increase was MSAN
678+
errors triggered on a call instruction.
679+
*/
680+
# define DEFAULT_THREAD_STACK (2L<<20)
681+
# elif defined(__SANITIZE_ADDRESS__) || defined(WITH_UBSAN)
672682
/*
673683
Optimized WITH_ASAN=ON executables produced
674684
by GCC 12.3.0, GCC 13.2.0, or clang 16.0.6

include/my_time.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ static inline longlong sec_part_unshift(longlong second_part, uint digits)
230230
/* Date/time rounding and truncation functions */
231231
static inline long my_time_fraction_remainder(long nr, uint decimals)
232232
{
233-
DBUG_ASSERT(decimals <= TIME_SECOND_PART_DIGITS);
234233
return nr % (long) log_10_int[TIME_SECOND_PART_DIGITS - decimals];
235234
}
236235
static inline void my_datetime_trunc(MYSQL_TIME *ltime, uint decimals)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Slow with MSAN, but if mtr --big-test specified, then it should complete
2+
if (!$BIG_TEST)
3+
{
4+
if (`select count(*) from information_schema.system_variables where variable_name='have_sanitizer' and global_value like "MSAN%"`)
5+
{
6+
--skip Can't be run WITH_MSAN unless using --big-test
7+
}
8+
}

mysql-test/include/not_msan.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# This file should only be used with tests that are too big or slow for MSAN.
1+
# This file should only be used with tests that are too big or slow for MSAN (even with --big-test).
2+
# Use no_msan_without_big instead unless this really won't complete in a test timeout period.
23

34
if (`select count(*) from information_schema.system_variables where variable_name='have_sanitizer' and global_value like "MSAN%"`)
45
{
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This file should only be used with tests that are too big or slow for MSAN with Debug.
2+
3+
if (`select count(*) from information_schema.system_variables where variable_name='have_sanitizer' and global_value like "MSAN%"`)
4+
{
5+
if (`select version() like '%debug%'`)
6+
{
7+
--skip Can't be run WITH_MSAN and CMAKE_BUILD_TYPE=Debug
8+
}
9+
}

mysql-test/main/alter_table_lock.test

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
--source include/not_msan.inc
2-
31
--echo #
42
--echo # MDEV-23836: Assertion `! is_set() || m_can_overwrite_status' in
53
--echo # Diagnostics_area::set_error_status (interrupted ALTER TABLE under LOCK)

mysql-test/main/backup_lock.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ col1
266266
SET AUTOCOMMIT = 0;
267267
UPDATE t_permanent_innodb SET col1 = 9;
268268
UPDATE t_permanent_aria SET col1 = 9;
269+
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
269270
UPDATE t_permanent_myisam SET col1 = 9;
270271
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
271272
UPDATE t_permanent_aria2 SET col1 = 9;

0 commit comments

Comments
 (0)