CREATE TABLE t LIKE <temporary table>

Bug #1212247 reported by Seppo Jaakola
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL patches by Codership
Status tracked in 5.6
5.5
Fix Released
Medium
Seppo Jaakola
5.6
Fix Released
Medium
Seppo Jaakola
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Status tracked in 5.6
5.5
Fix Released
Undecided
Unassigned
5.6
Fix Released
Undecided
Unassigned

Bug Description

CREATE TABLE t LIKE tmp, where tmp is a temporary table, will cause serious problem for replication.

This create statement will be replicated as plain SQL statement, and then the create statement will not be possible to apply in slave nodes, as the temporary table is not present there. If there are later DML for this table, all other nodes will crash, as DML cannot be applied due to missing table.

Changed in codership-mysql:
importance: Undecided → Medium
assignee: nobody → Seppo Jaakola (seppo-jaakola)
Changed in percona-xtradb-cluster:
milestone: none → 5.5.33-23.7.6
Changed in codership-mysql:
status: New → In Progress
milestone: none → 5.5.32-23.7.6
Revision history for this message
Seppo Jaakola (seppo-jaakola) wrote :

The fix replicates CREATE TABLE LIKE <tmp table> with two query log events:

1. first the CREATE TABLE for the source temporary table
2. then the actual CREATE TABLE LIKE... event

This way, the slave applier will get to see the definition of the temporary table. The temporary table is dropped in the slave applier at the end of processing of the replication bundle.

Fix is pushed in revision: http://bazaar.launchpad.net/~codership/codership-mysql/5.5-23/revision/3900

Changed in codership-mysql:
status: In Progress → Fix Committed
Changed in percona-xtradb-cluster:
status: New → Fix Committed
Changed in codership-mysql:
status: Fix Committed → Fix Released
Changed in percona-xtradb-cluster:
status: Fix Committed → Fix Released
Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

There are still issues with TEMPORARY TABLE as in https://bugs.launchpad.net/percona-xtradb-cluster/+bug/1212955/comments/32

I will need to rerun with TEMPORARY TABLE enabled in grammar with latest fixes.

Also need to evaluate if https://bugs.launchpad.net/percona-xtradb-cluster/+bug/1240098 is related to this.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

Tested with latest 5.5 (5.5-23 HEAD in case of codership) build, no issues there.

Tested with 5.6 HEAD and I am seeing node consistency compromise issues but no hangs.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

Actually, not able to replicate with 5.6 as well since we are hitting https://bugs.launchpad.net/bugs/1234395 in that case in debug builds and 'node consistency compromise' in release builds which is more due to lp:1234395

Revision history for this message
Seppo Jaakola (seppo-jaakola) wrote :

Merged the fix into wsrep-5.6 branch in revision: http://bazaar.launchpad.net/~codership/codership-mysql/5.6/revision/3993

Revision history for this message
Seppo Jaakola (seppo-jaakola) wrote :

Related fix for lp:1216904 merged into wsrep-5.6 branch in revision: http://bazaar.launchpad.net/~codership/codership-mysql/5.6/revision/3994

Revision history for this message
Seppo Jaakola (seppo-jaakola) wrote :

lp:1234395 was not related to "CREATE TABLE LIKE..." processing, marking this bug as fixed now

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXC-1419

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.