Subject: Re: mysql NOW() bug on Alpha?
To: Dave Huang , Simon Burge <simonb@wasabisystems.com>
From: netbsd alpha <netbsd_alpha@yahoo.com>
List: port-alpha
Date: 10/06/2000 07:25:26
wow! impressive! this worked. Thanks much dave and
simon. glad to be back in the present day instead of
2136.

mysql> select now();
+---------------------+
| now()               |
+---------------------+
| 2000-10-06 09:23:29 |
+---------------------+
1 row in set (0.09 sec)

mysql> status
--------------
./mysql  Ver 10.12 Distrib 3.23.25-beta, for
unknown-netbsd1.5. (alpha)

--- Dave Huang <khym@bga.com> wrote:
> On Fri, 6 Oct 2000, Dave Huang wrote:
> > Hmm, interesting... I bet it has to do with
> negative timezone offsets...
> > if I link /etc/localtime to GMT or Australia, it
> works, but US doesn't.
> 
> Yeah, that does seem to be the problem... when
> loading in the timezone
> info, it's stuffing the GMT offset into a 64-bit
> long rather than 32-bit
> int, so negative offsets are being treated as huge
> positive offsets. The
> patch below seems to fix the problem for me...
> perhaps the mysql-server
> package should be updated to use a more recent
> pthreads package rather
> than the one that comes with mysql? (devel/pth
> perhaps? or
> devel/unproven-pthreads? I dunno what the difference
> is between 'em :)
> 
> 
> --- mit-pthreads/gen/ctime.c.orig	Sun Oct 12
> 07:07:41 1997
> +++ mit-pthreads/gen/ctime.c	Fri Oct  6 08:07:31
> 2000
> @@ -129,7 +129,7 @@
>  ** Prototypes for static functions.
>  */
>  
> -static long			detzcode __P_((const char *));
> +static int32_t			detzcode __P_((const char *));
>  static const char *	getnum __P_((const char *, int
> *, int, int));
>  static const char *	getsecs __P_((const char *,
> long *));
>  static const char *	getoffset __P_((const char *,
> long *));
> @@ -175,7 +175,7 @@
>  time_t			altzone = 0;
>  #endif /* defined ALTZONE */
>  
> -static long detzcode(const char * codep)
> +static int32_t detzcode(const char * codep)
>  {
>  	long result;
>  	int	i;
> -- 
> Name: Dave Huang     |   Mammal, mammal / their
> names are called /
> INet: khym@bga.com   |   they raise a paw / the bat,
> the cat /
> FurryMUCK: Dahan     |   dolphin and dog / koala
> bear and hog -- TMBG
> Dahan: Hani G Y+C 24 Y++ L+++ W- C++ T++ A+ E+ S++
> V++ F- Q+++ P+ B+ PA+ PL++
> 
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/