mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Fix for bug #2523 '"func_time" test fails on QNX'.
Moved all range checks for TIMESTAMP value to my_gmt_sec(). Also fixed check of upper boundary of TIMESTAMP range (which also now will catch datetime values which are too small for TIMESTAMP in case if time_t is unsigned). mysql-test/r/timezone.result: Added test which checks if TIMESTAMP range is checked correctly (current time zone is honoured and both upper and lower bounds of TIMESTAMP range are checked). mysql-test/t/timezone.test: Added test which checks if TIMESTAMP range is checked correctly (current time zone is honoured and both upper and lower bounds of TIMESTAMP range are checked). sql/field.cc: Check if datetime value is in TIMESTAMP range has moved to my_gmt_sec() function. sql/mysql_priv.h: Added more constants for checking if datetime is in allowed range for TIMESTAMP. sql/time.cc: Check if datetime value is in TIMESTAMP range has moved to my_gmt_sec() function. Fixed check of its return value to catch overflows in both directions and also overflows in case of unsigned time_t.
This commit is contained in:
@@ -116,6 +116,9 @@ char* query_table_status(THD *thd,const char *db,const char *table_name);
|
||||
/* Time handling defaults */
|
||||
#define TIMESTAMP_MAX_YEAR 2038
|
||||
#define YY_PART_YEAR 70
|
||||
#define TIMESTAMP_MIN_YEAR (1900 + YY_PART_YEAR - 1)
|
||||
#define TIMESTAMP_MAX_VALUE 2145916799
|
||||
#define TIMESTAMP_MIN_VALUE 1
|
||||
#define PRECISION_FOR_DOUBLE 53
|
||||
#define PRECISION_FOR_FLOAT 24
|
||||
|
||||
|
||||
Reference in New Issue
Block a user