$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;
