Bug #46967 mysqlslap: setting --engine does not get replicated
Submitted: 28 Aug 2009 4:43 Modified: 28 Aug 2009 5:24
Reporter: Hakan Küçükyılmaz Email Updates:
Status: Verified Impact on me:
None 
Category:Tools Severity:S2 (Serious)
Version:5.0, 5.1 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution
Triage: Triaged: D2 (Serious)

[28 Aug 2009 4:43] Hakan Küçükyılmaz
Description:
Running mysqlslap with the --engine option against a master/slave replication leaves the slave with the default storage engine.

This is due to that the create table statement does not contain the storage engine. The storage engine is only set as "set storage_engine = <storage_engine>". 

How to repeat:
Setup a simple master/slave replication and run mysqlslap with an --engine option other than the default storage engine.

The table created by mysqlslap will have different storage engine types on master and slave.

Suggested fix:
=== modified file 'client/mysqlslap.c'
--- client/mysqlslap.c	2009-04-25 10:05:32 +0000
+++ client/mysqlslap.c	2009-08-28 04:25:56 +0000
@@ -880,6 +880,12 @@
     }
 
   dynstr_append(&table_string, ")");
+  
+  if (default_engine) {
+    dynstr_append(&table_string, " Engine = ");
+    dynstr_append(&table_string, default_engine);    
+  }
+
   ptr= (statement *)my_malloc(sizeof(statement), 
                               MYF(MY_ZEROFILL|MY_FAE|MY_WME));
   ptr->string = (char *)my_malloc(table_string.length+1,
[28 Aug 2009 5:24] Sveta Smirnova
Thank you for the report.

Verified as described.