List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:October 31 2001 12:04pm
Subject:bugs / inconsistencies with date functions
View as plain text  
Hi!

>>>>> "oliver" == oliver  <oliver@stripped> writes:

>> Description:
oliver> 	I have found some inconsistencies (one may call them bugs ;-) in the
oliver> 	current MySQL 3.23 version. I tested this on Linux and Solaris 2.8
oliver> 	so this should not be platform specific...
oliver> 	The result differs, if one uses the constant value "0000-00-00" or
oliver> 	if one uses a column which has the value "0000-00-00".
oliver> 	The following functions are affected: DAYOFMONTH, DAYOFYEAR, MONTH,
oliver> 	QUARTER, WEEK, YEAR, YEARWEEK, TO_DAYS, DATE_FORMAT and EXTRACT.
oliver> 	Not tested: DATE_ADD, DATE_SUB, ADDDATE and SUBDATE.

>> How-To-Repeat:
oliver> 	CREATE TABLE xx ( Gueltig DATE NOT NULL );
oliver> 	INSERT INTO xx VALUES ( "0000-00-00" );

oliver> 	SELECT DAYOFYEAR("0000-00-00"),Gueltig,DAYOFYEAR(Gueltig) FROM xx;
oliver> 	+-------------------------+------------+--------------------+
oliver> 	| DAYOFYEAR("0000-00-00") | Gueltig    | DAYOFYEAR(Gueltig) |
oliver> 	+-------------------------+------------+--------------------+
oliver> 	|                    NULL | 0000-00-00 |            -730484 |
oliver> 	+-------------------------+------------+--------------------+
oliver> 	1 row in set (0.00 sec)

<cut>

We will fix for 3.23.44 that 0000-00-00 should work identically if you
are using a column or a constant.

Regards,
Monty

-- 
For technical support contracts, goto https://order.mysql.com/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Michael Widenius <monty@stripped>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, CTO
/_/  /_/\_, /___/\___\_\___/   Helsinki, Finland
       <___/   www.mysql.com
Thread
ld_library_pathJulien CHATELLIER27 Aug
  • ld_library_pathsinisa27 Aug
  • Re: ld_library_path801) 250-O795 Work27 Aug
    • Re: ld_library_path801) 250-O795 Work27 Aug
  • bugs / inconsistencies with date functionsMichael Widenius31 Oct