Hi,
I think is not a bug.The result is normal becuase function TO_DAYS() return
the daynumber and not the date.If you wish to find a date depend on the
number of days you can try(like example):

select FROM_DAYS(TO_DAYS(NOW())-3);

Read the manual about this two functions

Regards,

Gelu
_____________________________________________________
G.NET SOFTWARE COMPANY

Permanent e-mail address : [EMAIL PROTECTED]
                                          [EMAIL PROTECTED]
----- Original Message -----
From: "Dobromir Velev" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 14, 2003 9:37 PM
Subject: May be bug in MySQL 4


> Hi,
> There might be a bug in mysql 4 (tested on 4.0.8-gamma and 4.0.9-gamma)
when
> combining simple arithmetic operations and date conversion
>
> I have a table with the following structure
> date_col date 0000-00-00
> int_col tinyint(3) unsigned
>
> This is what happens when I try to run a query like the one below.
>
> mysql> select to_days(Now())-to_days(data_col)-int_col
> from table_name where to_days(Now())-to_days(data_col)<int_col;
>
> +-----------------------------------+
> | to_days(Now())-to_days(date_col)-int_col |
> +-----------------------------------+
> |              18446744073709551607 |
> |              18446744073709551609 |
> |              18446744073709551607 |
> |              18446744073709551609 |
> |              18446744073709551607 |
> |              18446744073709551615 |
>
>
> Tested on Linux Redhat 7.3 and on a Slackware 7.0.0
>
> TIA
> Dobromir Velev
>
>
> ---------------------------------------------------------------------
> 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

Reply via email to