MDEV-36882: Inconsistent DBUG_ASSERT trips GCC -Og

my_time_fraction_remainder(): Remove a DBUG_ASSERT, because there is
none in sec_part_shift() or sec_part_unshift() either.  A buffer
overflow should be caught by cmake -DWITH_ASAN=ON in all three.
This fixes a build with GCC 14.2 and
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS=-Og.

Reviewed by: Daniel Black
This commit is contained in:
Marko Mäkelä
2025-05-27 08:05:19 +03:00
parent aba04c562b
commit 507cbde68f

View File

@ -230,7 +230,6 @@ static inline longlong sec_part_unshift(longlong second_part, uint digits)
/* Date/time rounding and truncation functions */
static inline long my_time_fraction_remainder(long nr, uint decimals)
{
DBUG_ASSERT(decimals <= TIME_SECOND_PART_DIGITS);
return nr % (long) log_10_int[TIME_SECOND_PART_DIGITS - decimals];
}
static inline void my_datetime_trunc(MYSQL_TIME *ltime, uint decimals)