diff options
author | petr/cps@mysql.com/owlet.local <> | 2006-11-01 16:47:40 +0300 |
---|---|---|
committer | petr/cps@mysql.com/owlet.local <> | 2006-11-01 16:47:40 +0300 |
commit | 3ec542dfbdd08c13a6c33b07f7ddd9650c0e0ad8 (patch) | |
tree | e2642512c7a6f4cbdaa661730aca0413380e045e /mysql-test/t/timezone2.test | |
parent | acaa584c5523753cab5b3a50ed3c95672b462541 (diff) | |
download | mariadb-git-3ec542dfbdd08c13a6c33b07f7ddd9650c0e0ad8.tar.gz |
Fix Bug #9191 "TIMESTAMP/from_unixtime() no longer accepts 2^31-1"
(4.1 version, with post-review fixes)
The fix for another Bug (6439) limited FROM_UNIXTIME() to
TIMESTAMP_MAX_VALUE which is 2145916799 or 2037-12-01 23:59:59 GMT,
however unix timestamp in general is not considered to be limited
by this value. All dates up to power(2,31)-1 are valid.
This patch extends allowed TIMESTAMP range so, that max
TIMESTAMP value is power(2,31)-1. It also corrects
FROM_UNIXTIME() and UNIX_TIMESTAMP() functions, so that
max allowed UNIX_TIMESTAMP() is power(2,31)-1. FROM_UNIXTIME()
is fixed accordingly to allow conversion of dates up to
2038-01-19 03:14:07 UTC. The patch also fixes CONVERT_TZ()
function to allow extended range of dates.
The main problem solved in the patch is possible overflows
of variables, used in broken-time representation to time_t
conversion (required for UNIX_TIMESTAMP).
Diffstat (limited to 'mysql-test/t/timezone2.test')
-rw-r--r-- | mysql-test/t/timezone2.test | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mysql-test/t/timezone2.test b/mysql-test/t/timezone2.test index 523249a3a2c..43f9a944be1 100644 --- a/mysql-test/t/timezone2.test +++ b/mysql-test/t/timezone2.test @@ -107,21 +107,21 @@ create table t1 (ts timestamp); set time_zone='UTC'; insert into t1 values ('0000-00-00 00:00:00'),('1969-12-31 23:59:59'), ('1970-01-01 00:00:00'),('1970-01-01 00:00:01'), - ('2037-12-31 23:59:59'),('2038-01-01 00:00:00'); + ('2038-01-19 03:14:07'),('2038-01-19 03:14:08'); select * from t1; delete from t1; # MET time zone has range shifted by one hour set time_zone='MET'; insert into t1 values ('0000-00-00 00:00:00'),('1970-01-01 00:30:00'), ('1970-01-01 01:00:00'),('1970-01-01 01:00:01'), - ('2038-01-01 00:59:59'),('2038-01-01 01:00:00'); + ('2038-01-19 04:14:07'),('2038-01-19 04:14:08'); select * from t1; delete from t1; # same for +01:30 time zone set time_zone='+01:30'; insert into t1 values ('0000-00-00 00:00:00'),('1970-01-01 01:00:00'), ('1970-01-01 01:30:00'),('1970-01-01 01:30:01'), - ('2038-01-01 01:29:59'),('2038-01-01 01:30:00'); + ('2038-01-19 04:44:07'),('2038-01-19 04:44:08'); select * from t1; drop table t1; @@ -171,8 +171,8 @@ select convert_tz('2003-10-26 01:00:00', 'MET', 'UTC'); select convert_tz('2003-10-26 02:00:00', 'MET', 'UTC'); select convert_tz('2003-10-26 02:59:59', 'MET', 'UTC'); select convert_tz('2003-10-26 04:00:00', 'MET', 'UTC'); -select convert_tz('2038-01-01 00:59:59', 'MET', 'UTC'); -select convert_tz('2038-01-01 01:00:00', 'MET', 'UTC'); +select convert_tz('2038-01-19 04:14:07', 'MET', 'UTC'); +select convert_tz('2038-01-19 04:14:08', 'MET', 'UTC'); select convert_tz('2103-01-01 04:00:00', 'MET', 'UTC'); # Let us test variable time zone argument |