Hello there,

I use MySQL (4.0.1) with InnoDB tables with binary logging on. 
I see that the
BEGIN and COMMIT statements that wrap my queries are 
not written to the binary log. I perfectly understand this if
I have one server. But assume I have a master server, and a 
slave server that replicates the master. Let's say I distribute reads. 
Let's say I issue the following queries on the master (I use 
BEGIN and COMMIT for consistency) :

BEGIN;
update accounts set sum=sum-100 where num=10;
update accounts set sum=sum+100 where num=12;
# I don't work in a bank !!
COMMIT;

then only

update accounts set sum=sum-100 where num=10;
update accounts set sum=sum+100 where num=12;

is written to the master's binary log, and then propagates
to the slave. Assume that, while it is propagating I issue 
a reading query on the slave :
select sum from accounts where num in(10,12);
Then, to my mind, this select might be treated AFTER the
first update being processed by the slave, and BEFORE the 
second update being processed by the slave.
Then I'll get not-consistent results.
This would not happen if BEGIN and COMMIT had been
written to the master's binary log.

Does anyone here agree or am I misunderstanding anything ?
If this problem really exists, is it to be fixed ?
Thanks !

Guilhem BICHOT
IPSN/DIR/SG/SI
01 46 54 92 31
mailto:[EMAIL PROTECTED]


---------------------------------------------------------------------
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