Jeremiah Foster wrote:
Hello all,

We are using an NOW() function in our database and occasionally it
produces odd results. There are entries where it states: 0000-00-00
00:00:00 instead of the current time. Is this a bug, or are we using the
function incorrectly?

MySQL version info:
mysql  Ver 12.22 Distrib 4.0.26, for portbld-freebsd4.11 (i386)

Hum, the little devil is playing you tricks, uh ?

It's easier that NOW() didn't run at all instead of producing Jesus' dates. Try a dummy insert on a dummy table just putting now() on a column and see if any of them gets out zero. If some does, it's a bug on MySQL, otherwise can be a problem while you're assembling your query.

mysql> use test; create table foo (a datetime);

bash$ for ((i=10000000; i; i--)); do echo "insert into foo values (now())" | mysql test; done

myslq> use test; select * from dates where a = "0000-00-00 00:00:00";


Should return no results.

cheers,
--renato

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to