Check datetime, date, or normalized time (i.e. time without days) range. @param ltime Datetime value. @returns @retval FALSE on success @retval TRUE on error */
| 192 | @retval TRUE on error |
| 193 | */ |
| 194 | my_bool check_datetime_range(const MYSQL_TIME *ltime) |
| 195 | { |
| 196 | /* |
| 197 | In case of MYSQL_TIMESTAMP_TIME hour value can be up to TIME_MAX_HOUR. |
| 198 | In case of MYSQL_TIMESTAMP_DATETIME it cannot be bigger than 23. |
| 199 | */ |
| 200 | return |
| 201 | ltime->year > 9999 || ltime->month > 12 || ltime->day > 31 || |
| 202 | ltime->minute > 59 || ltime->second > 59 || ltime->second_part > 999999 || |
| 203 | (ltime->hour > |
| 204 | (ltime->time_type == MYSQL_TIMESTAMP_TIME ? TIME_MAX_HOUR : 23)); |
| 205 | } |
| 206 | |
| 207 | |
| 208 | /* |
no outgoing calls
no test coverage detected