5 messages in com.mysql.lists.bugsRe: Replication RAND function bug
FromSent OnAttachments
Rune Hansen12 Jan 2001 05:20 
Sasha Pachev12 Jan 2001 21:35 
Rune Hansen13 Jan 2001 02:47 
Sasha Pachev13 Jan 2001 06:19 
Michael Widenius14 Jan 2001 02:49 
Subject:Re: Replication RAND function bug
From:Rune Hansen (rode@viventus.no)
Date:01/13/2001 02:47:48 AM
List:com.mysql.lists.bugs

On Fri, 12 Jan 2001 22:35:37 -0700 Sasha Pachev <sas@mysql.com> wrote:

On Friday 12 January 2001 06:20, Rune Hansen wrote:

Description:

UPDATE object SET timestamp=((POWER(2, 34) - UNIX_TIMESTAMP('pub_date') + ROUND(RAND(),3)) * 1 000

WHERE id ='16879'

I seem to have missed out a ")" and NOW() is a better example than 'pub_date' - the correct sql statement is:

UPDATE object SET timestamp=((POWER(2, 34) - UNIX_TIMESTAMP(NOW()) + ROUND(RAND(),3)) * 1 000) WHERE id ='16879'

This does not crash the master, but it crashes the slave. We encountered the bug on a production system when we were trying to optimize our sql (getting rid of ORDER BY and DISTINCT). If this bug is "expected behaviour" this shouldn't produce "15246878965000" on the slave when replicating "15246878965123" from the master. At this time we have no means to reproduce the bug except on the production server, but we will get back to you as soon as we get testing hardware/software in place.

As for the "Got an error" message. Thanks. Now we have to look at our PHP 4 code.

regards

We are but packets in the internett of life -Mike, Userfriendly