Bug #41046 replication fails when using create table like in a stored procedure
Submitted: 26 Nov 2008 9:56 Modified: 26 Dec 2008 10:19
Reporter: li pengcheng Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Replication Severity:S1 (Critical)
Version:5.0.22 OS:Linux
Assigned to: CPU Architecture:Any

[26 Nov 2008 9:56] li pengcheng
Description:
DELIMITER $$
DROP PROCEDURE IF EXISTS `pd_tmp_test` $$
CREATE PROCEDURE pd_tmp_test()
BEGIN
	Drop TABLE IF EXISTS tmp_cusday; 

	CREATE TABLE tmp_cusday (like cusday);
	
	
END$$
DELIMITER ;

[ERROR] Slave: Error 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1' on query. Default database: 'test'. Query: 'CREATE TEMPORARY TABLE tmp_cusday (like cusday', Error_code: 1064

How to repeat:
mysql> call pd_tmp_test();

slave replication failed.
[26 Nov 2008 10:19] Valeriy Kravchuk
Please, try to repeat with a newer version, 5.0.67, on both master and slave, and use correct syntax:

CREATE TABLE tmp_cusday LIKE cusday;

in your procedure. 

In case of the same problem, please, upload the corresponding binary log from master.
[27 Dec 2008 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".