summaryrefslogtreecommitdiff
path: root/databases/mysql51-server
diff options
context:
space:
mode:
authortaca <taca@pkgsrc.org>2010-08-13 14:25:34 +0000
committertaca <taca@pkgsrc.org>2010-08-13 14:25:34 +0000
commit9604af49ad96d796319d9b23ae45c9d3bd8dcbc9 (patch)
treead9f2fb6f7a5da0f35ccd698489f1f3c9d2b8b85 /databases/mysql51-server
parent64a1b5a103e35b1df492624a1b997cac3f0b9c6e (diff)
downloadpkgsrc-9604af49ad96d796319d9b23ae45c9d3bd8dcbc9.tar.gz
Fix some my_time_t (long) v.s. time_t problem introduced MySQL 5.1.49.
This problem results mysqld to exit on start up. 5.1/i386 5.1/amd64 5.99.38/i386 5.99.38/amd64 my_time_t int32_t int64_t int32_t int64_t time_t int32_t int32_t int64_t int64_t I confirmed to mysqld running on these four case except 5.99.38/i386. Bump PKG_REVISION.
Diffstat (limited to 'databases/mysql51-server')
-rw-r--r--databases/mysql51-server/Makefile3
-rw-r--r--databases/mysql51-server/distinfo8
-rw-r--r--databases/mysql51-server/patches/patch-ae17
-rw-r--r--databases/mysql51-server/patches/patch-ay14
-rw-r--r--databases/mysql51-server/patches/patch-az26
-rw-r--r--databases/mysql51-server/patches/patch-ba22
-rw-r--r--databases/mysql51-server/patches/patch-bb25
7 files changed, 109 insertions, 6 deletions
diff --git a/databases/mysql51-server/Makefile b/databases/mysql51-server/Makefile
index d5cdb7ff40f..38bdca3025e 100644
--- a/databases/mysql51-server/Makefile
+++ b/databases/mysql51-server/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.5 2010/04/24 15:59:23 taca Exp $
+# $NetBSD: Makefile,v 1.6 2010/08/13 14:25:34 taca Exp $
PKGNAME= ${DISTNAME:S/-/-server-/}
+PKGREVISION= 1
SVR4_PKGNAME= mysqs
COMMENT= MySQL 5, a free SQL database (server)
diff --git a/databases/mysql51-server/distinfo b/databases/mysql51-server/distinfo
index cc8541b0ac3..66ea6c75220 100644
--- a/databases/mysql51-server/distinfo
+++ b/databases/mysql51-server/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.8 2010/08/11 23:18:04 taca Exp $
+$NetBSD: distinfo,v 1.9 2010/08/13 14:25:35 taca Exp $
SHA1 (mysql-5.1.49.tar.gz) = c173614fa307eeed34607292205290715f20bcd5
RMD160 (mysql-5.1.49.tar.gz) = e4d43fa48f1c2ffe16c16119422fd9f3d1c812b2
@@ -7,7 +7,7 @@ SHA1 (patch-aa) = 2a5321738e637a56e57cd6b1b40908d2bf275506
SHA1 (patch-ab) = 39ca30e2e78645bb6975d057ace30e8c91e6e405
SHA1 (patch-ac) = bfb6eec77d7c5aa8d2b849632769005dcf2e272c
SHA1 (patch-ad) = 5fd4db0e04a97289f38a5467bbae5041f4082b51
-SHA1 (patch-ae) = c7f8c12c64835650b80aed4fef44d44b15f3f11e
+SHA1 (patch-ae) = e682e8c7a260706cbfd802885bfe100c0e0d31be
SHA1 (patch-af) = 1e13ba542b4fc2a1d59fc822d06c76bc4e92dc23
SHA1 (patch-ag) = c510685dd71e4e3a632c9bf01e4e36eb42945d9e
SHA1 (patch-ah) = a608060cee7aadaf8bcde84016a73131a75dea32
@@ -25,3 +25,7 @@ SHA1 (patch-at) = 307a0785190f8bc175226ce83288cc85f7da4631
SHA1 (patch-au) = 51291771b994d199fb6de6a17dd7809a7bf39b68
SHA1 (patch-aw) = 93ba34d66fd054fbcf9e1eb3a042770d4d6820ec
SHA1 (patch-ax) = dbf68af2d2ded85140aac3602d4f6ce5d68cc78a
+SHA1 (patch-ay) = f70896ae71e0ca7840e9966f43c757dd5b6c87b9
+SHA1 (patch-az) = cfe77df58645dfad65ce4ff8eae868f059231233
+SHA1 (patch-ba) = f595d2063ff18c0afb7e45c41d84a22ca9c99b44
+SHA1 (patch-bb) = 11f23c63a14d301a7dfa67d6c399a748ec5631b2
diff --git a/databases/mysql51-server/patches/patch-ae b/databases/mysql51-server/patches/patch-ae
index f12aa2585a6..c60609bc9be 100644
--- a/databases/mysql51-server/patches/patch-ae
+++ b/databases/mysql51-server/patches/patch-ae
@@ -1,8 +1,19 @@
-$NetBSD: patch-ae,v 1.1.1.1 2010/03/04 16:28:58 taca Exp $
+$NetBSD: patch-ae,v 1.2 2010/08/13 14:25:35 taca Exp $
---- configure.in.orig 2010-02-04 11:36:59.000000000 +0000
+* check sizeof time_t.
+* check existence of sigsend().
+
+--- configure.in.orig 2010-07-09 12:34:57.000000000 +0000
+++ configure.in
-@@ -2023,7 +2023,7 @@ AC_CHECK_HEADERS(varargs.h stdarg.h dire
+@@ -1946,6 +1946,7 @@ if test "$ac_cv_sizeof_off_t" -eq 0
+ then
+ AC_MSG_ERROR("MySQL needs a off_t type.")
+ fi
++AC_CHECK_SIZEOF(time_t, 4)
+
+ dnl
+ dnl check if time_t is unsigned
+@@ -2039,7 +2040,7 @@ AC_CHECK_HEADERS(varargs.h stdarg.h dire
paths.h semaphore.h)
# Already-done: strcasecmp
diff --git a/databases/mysql51-server/patches/patch-ay b/databases/mysql51-server/patches/patch-ay
new file mode 100644
index 00000000000..ee719e18e8b
--- /dev/null
+++ b/databases/mysql51-server/patches/patch-ay
@@ -0,0 +1,14 @@
+$NetBSD: patch-ay,v 1.3 2010/08/13 14:25:35 taca Exp $
+
+--- include/config.h.in.orig 2010-08-12 15:56:26.000000000 +0000
++++ include/config.h.in
+@@ -1199,6 +1199,9 @@
+ /* The size of `short', as computed by sizeof. */
+ #undef SIZEOF_SHORT
+
++/* The size of `time_t', as computed by sizeof. */
++#undef SIZEOF_TIME_T
++
+ /* The size of `void*', as computed by sizeof. */
+ #undef SIZEOF_VOIDP
+
diff --git a/databases/mysql51-server/patches/patch-az b/databases/mysql51-server/patches/patch-az
new file mode 100644
index 00000000000..b8bed5c32d4
--- /dev/null
+++ b/databases/mysql51-server/patches/patch-az
@@ -0,0 +1,26 @@
+$NetBSD: patch-az,v 1.1 2010/08/13 14:25:35 taca Exp $
+
+* if long is int64_t and time_t is int32_t, "(time_t) MY_TIME_T_MAX"
+ results -1 and server_start_time is always parsed as exceeding limit.
+ So, use TIMESTAMP_MAX_VALUE which is INT_MAX32.
+* if time_t is int32_t, comparsion with TIMESTAMP_MAX_VALUE is always
+ true here. So, limit the comparsion to other cases.
+
+--- sql/mysqld.cc.orig 2010-07-09 12:34:57.000000000 +0000
++++ sql/mysqld.cc
+@@ -3240,12 +3240,13 @@ static int init_common_variables(const c
+
+ max_system_variables.pseudo_thread_id= (ulong)~0;
+ server_start_time= flush_status_time= my_time(0);
+- /* TODO: remove this when my_time_t is 64 bit compatible */
+- if (server_start_time >= (time_t) MY_TIME_T_MAX)
++#if defined(TIME_T_UNSIGNE) || (SIZEOF_TIME_T > 4)
++ if (server_start_time >= TIMESTAMP_MAX_VALUE)
+ {
+ sql_print_error("This MySQL server doesn't support dates later then 2038");
+ return 1;
+ }
++#endif
+
+ rpl_filter= new Rpl_filter;
+ binlog_filter= new Rpl_filter;
diff --git a/databases/mysql51-server/patches/patch-ba b/databases/mysql51-server/patches/patch-ba
new file mode 100644
index 00000000000..8553c2614b7
--- /dev/null
+++ b/databases/mysql51-server/patches/patch-ba
@@ -0,0 +1,22 @@
+$NetBSD: patch-ba,v 1.1 2010/08/13 14:25:35 taca Exp $
+
+* if long is int64_t and time_t is int32_t, "(time_t) MY_TIME_T_MAX"
+ results -1 and val is always parsed as exceeding limit.
+ So, use TIMESTAMP_MAX_VALUE which is INT_MAX32 and make val to ulonglong
+ for safer comparsion.
+
+--- sql/set_var.cc.orig 2010-07-09 12:34:53.000000000 +0000
++++ sql/set_var.cc
+@@ -2720,10 +2720,9 @@ int set_var_collation_client::update(THD
+
+ bool sys_var_timestamp::check(THD *thd, set_var *var)
+ {
+- time_t val;
++ ulonglong 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 || val > TIMESTAMP_MAX_VALUE)
+ {
+ my_message(ER_UNKNOWN_ERROR,
+ "This version of MySQL doesn't support dates later than 2038",
diff --git a/databases/mysql51-server/patches/patch-bb b/databases/mysql51-server/patches/patch-bb
new file mode 100644
index 00000000000..b99d6bf184d
--- /dev/null
+++ b/databases/mysql51-server/patches/patch-bb
@@ -0,0 +1,25 @@
+$NetBSD: patch-bb,v 1.1 2010/08/13 14:25:35 taca Exp $
+
+* if long is int64_t and time_t is int32_t, "(time_t) MY_TIME_T_MAX"
+ results -1 and server_start_time is always parsed as exceeding limit.
+ So, use TIMESTAMP_MAX_VALUE which is INT_MAX32.
+* if time_t is int32_t, comparsion with TIMESTAMP_MAX_VALUE is always
+ true here. So, limit the comparsion to other cases.
+
+--- sql/sql_class.h.orig 2010-07-09 12:34:57.000000000 +0000
++++ sql/sql_class.h
+@@ -2031,8 +2031,12 @@ public:
+ }
+ /*TODO: this will be obsolete when we have support for 64 bit my_time_t */
+ inline bool is_valid_time()
+- {
+- return (start_time < (time_t) MY_TIME_T_MAX);
++ {
++#if defined(TIME_T_UNSIGNE) || (SIZEOF_TIME_T > 4)
++ return (start_time < TIMESTAMP_MAX_VALUE);
++#else
++ return 1;
++#endif
+ }
+ void set_time_after_lock() { utime_after_lock= my_micro_time(); }
+ ulonglong current_utime() { return my_micro_time(); }