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

Function check_time_range_quick

sql-common/my_time.c:174–184  ·  view source on GitHub ↗

Check TIME range. The value can include day part, for example: '1 10:20:30.123456'. minute, second and second_part values are not checked unless hour is equal TIME_MAX_HOUR. @param ltime Rime value. @returns Test result. @retval FALSE if value is Ok. @retval TRUE if value is out of range. */

Source from the content-addressed store, hash-verified

172 @retval TRUE if value is out of range.
173*/
174inline my_bool check_time_range_quick(const MYSQL_TIME *ltime)
175{
176 longlong hour= (longlong) ltime->hour + 24LL * ltime->day;
177 /* The input value should not be fatally bad */
178 DBUG_ASSERT(!check_time_mmssff_range(ltime));
179 if (hour <= TIME_MAX_HOUR &&
180 (hour != TIME_MAX_HOUR || ltime->minute != TIME_MAX_MINUTE ||
181 ltime->second != TIME_MAX_SECOND || !ltime->second_part))
182 return FALSE;
183 return TRUE;
184}
185
186
187/**

Callers 2

adjust_time_rangeFunction · 0.85

Calls 1

check_time_mmssff_rangeFunction · 0.85

Tested by

no test coverage detected