Bug #12345 create table t5 select * from temporary table fails to replicate using RBR
Submitted: 3 Aug 2005 12:39 Modified: 21 Jun 2010 0:44
Reporter: Jonathan Miller Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:5.0-wl1012 OS:Linux (Linux)
Assigned to: Mats Kindahl CPU Architecture:Any

[3 Aug 2005 12:39] Jonathan Miller
Description:
Using a temporary table on the master to create a table will not be replicated to slave using row based replication.

How to repeat:
setup repilcation using binlog-format=row

master> create table t2(id int auto_increment primary key, created datetime);
Query OK, 0 rows affected (0.01 sec)

slavel> show tables;
+----------------+
| Tables_in_test |
+----------------+
| t2             |
+----------------+
1 row in set (0.00 sec)

master> insert into t2 set created=now();
Query OK, 1 row affected (0.00 sec)

master> select * from t2;
+----+---------------------+
| id | created             |
+----+---------------------+
|  1 | 2005-08-03 14:26:51 |
+----+---------------------+
1 row in set (0.00 sec)

slave> select * from t2;
+----+---------------------+
| id | created             |
+----+---------------------+
|  1 | 2005-08-03 14:26:51 |
+----+---------------------+
1 row in set (0.00 sec)

master> create temporary table t4 like t2;
Query OK, 0 rows affected (0.00 sec)

master>create table t5 select * from t4;
Query OK, 0 rows affected (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0

master> show tables;
+----------------+
| Tables_in_test |
+----------------+
| t2             |
| t5             |
+----------------+
2 rows in set (0.01 sec)

slave> show tables;
+----------------+
| Tables_in_test |
+----------------+
| t2             |
+----------------+
1 row in set (0.00 sec)

Suggested fix:
table should be replicated.
[1 Dec 2005 19:31] Mats Kindahl
This bug was fixed as part of WL#2867.
[13 Feb 2009 11:30] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/66180

3037 Davi Arnaut	2009-02-13 [merge]
      Merge from 5.1-bugteam branch for Bug#12345
      modified:
        README

=== modified file 'README'
--- a/README	2008-03-26 10:15:03 +0000
+++ b/README	2009-02-13 10:34:51 +0000
@@ -28,8 +28,6 @@ directory in GNU Info format.  You can a
 download it in any of several formats at the URL given earlier in this
 file.
 
-************************************************************
-
 IMPORTANT:
 
 Bug or error reports should be sent to http://bugs.mysql.com.

-- 
MySQL Code Commits Mailing List
For list archives: http://lists.mysql.com/commits
To unsubscribe:    http://lists.mysql.com/commits?unsub=commits@bugs.mysql.com
[5 May 2010 15:19] Bugs System
Pushed into 5.1.47 (revid:joro@sun.com-20100505145753-ivlt4hclbrjy8eye) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[6 May 2010 1:31] Paul DuBois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug. Re-closing.
[28 May 2010 5:57] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100524190136-egaq7e8zgkwb9aqi) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (pib:16)
[28 May 2010 6:26] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100524190941-nuudpx60if25wsvx) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[28 May 2010 6:54] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100524185725-c8k5q7v60i5nix3t) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[29 May 2010 2:58] Paul DuBois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug.
Re-closing.
[15 Jun 2010 8:17] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100615080459-smuswd9ooeywcxuc) (version source revid:mmakela@bk-internal.mysql.com-20100415070122-1nxji8ym4mao13ao) (merge vers: 5.1.47) (pib:16)
[15 Jun 2010 8:34] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100615080558-cw01bzdqr1bdmmec) (version source revid:mmakela@bk-internal.mysql.com-20100415070122-1nxji8ym4mao13ao) (pib:16)
[17 Jun 2010 11:59] Bugs System
Pushed into 5.1.47-ndb-7.0.16 (revid:martin.skold@mysql.com-20100617114014-bva0dy24yyd67697) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 12:40] Bugs System
Pushed into 5.1.47-ndb-6.2.19 (revid:martin.skold@mysql.com-20100617115448-idrbic6gbki37h1c) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 13:25] Bugs System
Pushed into 5.1.47-ndb-6.3.35 (revid:martin.skold@mysql.com-20100617114611-61aqbb52j752y116) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)