List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:August 29 1999 12:51am
Subject:year() and/or now() broken in 23.3
View as plain text  
>>>>> "Neulinger," == Neulinger, Nathan R <nneul@stripped> writes:

Neulinger,> YEAR(NOW()) does not work in 23.3. This has broken a number of my
Neulinger,> applications. It doesn't look to me like it makes any sense, as it works
Neulinger,> just fine in the older versions and it works just fine for a hardwired
date,
Neulinger,> but not if you use NOW(). Output below.

Neulinger,> I've applied the store/retrieve macro patch for fixing sum(). This is built
Neulinger,> on linux with pgcc.

Neulinger,> -- Nathan

Neulinger,> --------------
Neulinger,> select now()
Neulinger,> --------------

Neulinger,> +---------------------+
Neulinger,> | now()               |
Neulinger,> +---------------------+
Neulinger,> | 1999-08-25 08:57:47 |
Neulinger,> +---------------------+
Neulinger,> 1 row in set (0.00 sec)

Neulinger,> --------------
Neulinger,> select year(now())
Neulinger,> --------------

Neulinger,> +-------------+
Neulinger,> | year(now()) |
Neulinger,> +-------------+
Neulinger,> |          99 |
Neulinger,> +-------------+
Neulinger,> 1 row in set (0.00 sec)

Hi!

MySQL 3.23 has better, faster DATE handling and this problem was
caused by a bug in this new code.

Here is a fix for this:

replace "start->tm_year;" "start->tm_year+1900;" -- sql/item_timefunc.cc

(Sorry, I can't easily make a patch for this as the code has changed a 
lot;  I recently added a LOT of small changes to compile without
warnings with gcc 2.95)

Regards,
Monty
Thread
year() and/or now() broken in 23.3Nathan R. Neulinger25 Aug
  • year() and/or now() broken in 23.3Michael Widenius29 Aug
  • MySQL Connector/ODBC 3.51.17 fails to work with MS Access 2002Jerry Schwartz18 Jul