MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / adjust_time_range

Function adjust_time_range

sql-common/my_time.c:894–903  ·  view source on GitHub ↗

Adjust 'time' value to lie in the MYSQL_TIME range. If the time value lies outside of the range [-838:59:59, 838:59:59], set it to the closest endpoint of the range and set MYSQL_TIME_WARN_OUT_OF_RANGE flag in the 'warning' variable. @param time pointer to MYSQL_TIME value @param warning set MYSQL_TIME_WARN_OUT_OF_RANGE flag if the value is out of range */

Source from the content-addressed store, hash-verified

892 @param warning set MYSQL_TIME_WARN_OUT_OF_RANGE flag if the value is out of range
893*/
894void adjust_time_range(struct st_mysql_time *my_time, int *warning)
895{
896 DBUG_ASSERT(!check_time_mmssff_range(my_time));
897 if (check_time_range_quick(my_time))
898 {
899 my_time->day= my_time->second_part= 0;
900 set_max_hhmmss(my_time);
901 *warning|= MYSQL_TIME_WARN_OUT_OF_RANGE;
902 }
903}
904
905
906/*

Callers 4

str_to_timeFunction · 0.85
sec_to_timeFunction · 0.85

Calls 3

check_time_mmssff_rangeFunction · 0.85
check_time_range_quickFunction · 0.85
set_max_hhmmssFunction · 0.85

Tested by

no test coverage detected