Bug #38917 mysqlslap's --auto-generate-sql feature is not compatible with low version
Submitted: 20 Aug 2008 14:20
Reporter: zhiwen xiao Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version:5.1.26 OS:Any
Assigned to: CPU Architecture:Any
Tags: mysqlslap

[20 Aug 2008 14:20] zhiwen xiao
Description:
mysqlslap's --auto-generate-sql feature is not compatible with lower mysql version which not support SQL keys: SCHEMA, storage_engine, serial

How to repeat:
mysql> select version();
+------------------+
| version()        |
+------------------+
| 4.0.16-debug-log | 
+------------------+
1 row in set (0.00 sec)

command:
mysqlslap --auto-generate-sql --user=root --auto-generate-sql-load-type=write --auto-generate-sql-add-autoincrement --concurrency=100 --engine=innodb --iterations=1 --debug-info 

--results:
mysqlslap: Cannot drop database 'mysqlslap' 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 'SCHEMA IF EXISTS `mysqlslap`' at line 1

mysqlslap: Cannot set default engine: Unknown system variable 'storage_engine'

mysqlslap: Cannot run query CREATE TABLE `t1` (id serial,intcol1 INT(32) ,charcol1 VARCHAR(128)) 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 'serial,intcol1 INT(32) ,charcol1 VARCHAR(128))' at line 1

Suggested fix:
check server version or use compatible sql