diff options
author | taca <taca@pkgsrc.org> | 2011-08-04 09:09:41 +0000 |
---|---|---|
committer | taca <taca@pkgsrc.org> | 2011-08-04 09:09:41 +0000 |
commit | 1feef3f19f706360ab992331bbf7e972ec70acfd (patch) | |
tree | 23ae32b50a9581eb0b82d7529997aa796d0227a3 /databases/mysql5-server | |
parent | 2790c62b3113fa985de297d3bf30d03b304ce824 (diff) | |
download | pkgsrc-1feef3f19f706360ab992331bbf7e972ec70acfd.tar.gz |
Apply patch that in PR pkg/45214 by Robert Elz.
I've tested on 64bit time_t environment, too.
Diffstat (limited to 'databases/mysql5-server')
-rw-r--r-- | databases/mysql5-server/distinfo | 6 | ||||
-rw-r--r-- | databases/mysql5-server/patches/patch-sql-common_my__time.c | 7 | ||||
-rw-r--r-- | databases/mysql5-server/patches/patch-sql_set__var.cc | 9 |
3 files changed, 12 insertions, 10 deletions
diff --git a/databases/mysql5-server/distinfo b/databases/mysql5-server/distinfo index 3537cf76fbe..9206c729d8b 100644 --- a/databases/mysql5-server/distinfo +++ b/databases/mysql5-server/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.27 2011/08/02 16:15:08 taca Exp $ +$NetBSD: distinfo,v 1.28 2011/08/04 09:09:41 taca Exp $ SHA1 (mysql-5.0.92.tar.gz) = 10fffc7672a469af4a7fd980922b04d7ba0143ba RMD160 (mysql-5.0.92.tar.gz) = 24a373a1b124acf39d0c0726e5cb6f47dc1bef08 @@ -24,7 +24,7 @@ SHA1 (patch-cc) = 5dc7423892271cf9be86be71de10d275532a8541 SHA1 (patch-include_my__time.h) = 369fb468388bdec4e8449927e2109a8839fdde8a SHA1 (patch-mysql-test_r_func__time.result) = c85c6ff7981adf9dd10a4d1724e0b94616dcbe1c SHA1 (patch-mysql-test_t_func__time.test) = 5ff59d3fb9486a34ab23f33a942c2bd16be87776 -SHA1 (patch-sql-common_my__time.c) = 7056ca896030d26a30ba2c34a6adcd335fadfdb6 +SHA1 (patch-sql-common_my__time.c) = 8fa7f2f54cccf778c316e311dec8a39a87b9fc57 SHA1 (patch-sql_mysqld.cc) = ae26b56f5ede21ed975005f47994b685b2c8083e -SHA1 (patch-sql_set__var.cc) = 5dbbeeb5e3db648da395b372535e780da8ef294f +SHA1 (patch-sql_set__var.cc) = 149b35a73c5b82094fc5188b872904aaeb9f2329 SHA1 (patch-sql_sql__class.h) = 27fc6cc1684288b7ca517915af69a4ef8447c691 diff --git a/databases/mysql5-server/patches/patch-sql-common_my__time.c b/databases/mysql5-server/patches/patch-sql-common_my__time.c index c0fb1d8bbf5..3b0df49a884 100644 --- a/databases/mysql5-server/patches/patch-sql-common_my__time.c +++ b/databases/mysql5-server/patches/patch-sql-common_my__time.c @@ -1,10 +1,10 @@ -$NetBSD: patch-sql-common_my__time.c,v 1.1 2011/08/02 16:15:08 taca Exp $ +$NetBSD: patch-sql-common_my__time.c,v 1.2 2011/08/04 09:09:41 taca Exp $ * Handling of time_t: http://lists.mysql.com/commits/128103 --- sql-common/my_time.c.orig 2011-01-25 11:28:00.000000000 +0000 +++ sql-common/my_time.c -@@ -984,8 +984,16 @@ my_system_gmt_sec(const MYSQL_TIME *t_sr +@@ -984,8 +984,17 @@ my_system_gmt_sec(const MYSQL_TIME *t_sr So, tmp < TIMESTAMP_MIN_VALUE will be triggered. On platfroms with unsigned time_t tmp+= shift*86400L might result in a number, larger then TIMESTAMP_MAX_VALUE, so another check will work. @@ -17,8 +17,9 @@ $NetBSD: patch-sql-common_my__time.c,v 1.1 2011/08/02 16:15:08 taca Exp $ - if ((tmp < TIMESTAMP_MIN_VALUE) || (tmp > TIMESTAMP_MAX_VALUE)) + if ((tmp < TIMESTAMP_MIN_VALUE) +#if SIZEOF_TIME_T > 4 -+ || (tmp > TIMESTAMP_MAX_VALUE)) ++ || (tmp > TIMESTAMP_MAX_VALUE) +#endif ++ ) tmp= 0; return (my_time_t) tmp; diff --git a/databases/mysql5-server/patches/patch-sql_set__var.cc b/databases/mysql5-server/patches/patch-sql_set__var.cc index bb06756d4d9..549bef24ecf 100644 --- a/databases/mysql5-server/patches/patch-sql_set__var.cc +++ b/databases/mysql5-server/patches/patch-sql_set__var.cc @@ -1,18 +1,19 @@ -$NetBSD: patch-sql_set__var.cc,v 1.1 2011/08/02 16:15:08 taca Exp $ +$NetBSD: patch-sql_set__var.cc,v 1.2 2011/08/04 09:09:41 taca Exp $ * Handling of time_t: http://lists.mysql.com/commits/128103 --- sql/set_var.cc.orig 2011-01-25 11:27:51.000000000 +0000 +++ sql/set_var.cc -@@ -2717,7 +2717,10 @@ bool sys_var_timestamp::check(THD *thd, +@@ -2717,7 +2717,11 @@ bool sys_var_timestamp::check(THD *thd, time_t val; var->save_result.ulonglong_value= var->value->val_int(); val= (time_t) var->save_result.ulonglong_value; - if (val < (time_t) MY_TIME_T_MIN || val > (time_t) MY_TIME_T_MAX) + if ((val < TIMESTAMP_MIN_VALUE) +#if SIZEOF_TIME_T > 4 -+ || (val > TIMESTAMP_MAX_VALUE)) -+#endif) ++ || (val > TIMESTAMP_MAX_VALUE) ++#endif ++ ) { my_message(ER_UNKNOWN_ERROR, "This version of MySQL doesn't support dates later than 2038", |