MySQL Forums
Forum List  »  Replication

Re: Replication, Stored Procedures & Temporary Tables
Posted by: Adam Newman
Date: July 12, 2012 02:34AM

Thanks for the reply! You wrote:

>> Did you checked the error log ? what error you have in error log.

The error log indicates that the slave could not execute the statement. The statement was an insert on a temporary table that no longer exists on the slave because of the interruption to the slave (this is the described failure mode in the OP).

>> I am not sure about this, but i thought it should work. If stored procedure is inserting data into table on master it's only log the insert statement on slave not the stored procedure call so replicate-ignore flags should work. Might be a bug

Maybe. I will raise it as a bug with the developers.

>> Simply before stored procedure use SET SESSION sql_log_bin=0 this will not log to binary log on master and it should not be a problem because binary logs are off for stored procedure session and will not replicate further.

As already described in my OP, this method is too dangerous. If the Stored Procedure fails for whatever reason before calling SET SESSION sql_log_bin=1, then the binlogging will be permanently disabled for that session. This means we will lose data on any subsequent statements that we do wish to replicate.

:(

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Replication, Stored Procedures & Temporary Tables
1661
July 12, 2012 02:34AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.