For over a year the topic of mathematical operations on date values
has been disussed. It has never been possible to perform such math
on a date value without using DATE_ADD or converting the to days or
seconds first.
Why is this now all the sudden a reasonable bug?
Aurelian:
I suggest that you use DATE_ADD, I'm quite sure what you have found
is not a bug
20010501 - 1 = 20010500
MySQL sees CURRENT_DATE as the value 20010501 and performs your subtraction
as requested, if you want to subtract a day from today I suggest
DATE_ADD( CURRENT_DATE, INTERVAL -1 DAY )
Or the previously suggested TO_DAYS, FROM_DAYS method.
Sinisa Milivojevic wrote:
>
> Aurelian Dumitru writes:
> >
> >
> >
> > Please record the following bug identified on the MySQL server:
> >
> > 1. Hardware: SUN Ultra 10
> > 2. Operating system: Sun Solaris 2.7
> > 2. MySQL server version: 3.23.33
> > 3. Error description:
> > - The following SQL statement returns incorrect results when is executed
> > using the 'mysql' client: SELECT @myvar := ( CURRENT_DATE - 1) ;
> > - I ran this query every day. It worked fine untill May 1st, 2001, when the
> > above query returned the following value: 20010500 . It should have returned
> > 20010430.
> >
> > Aurelian Dumitru
> > [EMAIL PROTECTED]
>
> Hi!
>
> Thank you for a repeatable bug report.
>
> Regards,
>
> Sinisa
>
> ____ __ _____ _____ ___ == MySQL AB
> /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic
> /*/ /*/ /*/ \*\_ |*| |*||*| mailto:[EMAIL PROTECTED]
> /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Larnaca, Cyprus
> /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____
> ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^
> /*/ \*\ Developers Team
>
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php