From: MARK CALLAGHAN Date: December 7 2010 2:38pm Subject: Re: Is there a way to associate BINLOG position with specific COMMIT command List-Archive: http://lists.mysql.com/replication/2040 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Mon, Dec 6, 2010 at 11:23 PM, Mats Kindahl wro= te: > Hi Niv, > > If I understand your question right, you would like to do something like > this: > > =A0 =A0BEGIN; > =A0 =A0. > =A0 =A0. > =A0 =A0. > =A0 =A0COMMIT; > =A0 =A0SELECT LAST_BINLOG_POS(); > > Unfortunately, there is no good and safe way to see where a transaction > or a statement were written in the binary log in a thread. The best > approach is to use SHOW MASTER STATUS to get a file and position, but > this command assumes that you do not write anything between the last > commit and the command. If you want to ensure that no other thread > writes anything between the commit and when you fetch the position, you > have to lock some table that you use to serialize all transactions. Mats - I assume you mean no good way without modifying the server and that I could add the SQL command COMMIT_AND_RETURN_BINLOG_POS. --=20 Mark Callaghan mdcallag@stripped