From ef55f2dcdbc79c78aa37e6646ac2aef62c23e7d3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Jan 2004 19:15:11 +0300 Subject: 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. --- mysql-test/t/timezone.test | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mysql-test/t/timezone.test') diff --git a/mysql-test/t/timezone.test b/mysql-test/t/timezone.test index ab732c11a34..ba65eb72fe6 100644 --- a/mysql-test/t/timezone.test +++ b/mysql-test/t/timezone.test @@ -38,3 +38,10 @@ INSERT INTO t1 (ts) VALUES (Unix_timestamp('2003-03-30 04:00:01')); SELECT ts,from_unixtime(ts) FROM t1; DROP TABLE t1; +# +# Test for fix for Bug#2523 +# +select unix_timestamp('1970-01-01 01:00:00'), + unix_timestamp('1970-01-01 01:00:01'), + unix_timestamp('2038-01-01 00:59:59'), + unix_timestamp('2038-01-01 01:00:00'); -- cgit v1.2.1