Bug #18015 mysqlslap: cannot use multiple files in --query or --create
Submitted: 7 Mar 2006 10:11 Modified: 11 Apr 2006 21:25
Reporter: Axel Schwenke Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version: OS:
Assigned to: Magnus Blåudd CPU Architecture:Any

[7 Mar 2006 10:11] Axel Schwenke
Description:
Contrary to the documentation, mysqlslap cannot read multiple files for the --create or --query options. The filenames are used as SQL statements instead.

If specifying multiple --create options, all but the last are silently(!) ignored. This should give a warning. Better: multiple --create / --query arguments should be allowed and executed in the given order.

How to repeat:
~ $echo "create table t1 (c1 int)" >c1.sql
~ $echo "create table t2 (c1 int)" >c2.sql

~ $mysqlslap --create=c1.sql,c2.sql 
mysqlslap: Cannot run query c1.sql,c2.sql ERROR : You have an error in your SQL 
syntax; check the manual that corresponds to your MySQL server version for the r
ight syntax to use near 'c1.sql,c2.sql' at line 1

~ $mysqlslap --create="c1.sql,c2.sql"
mysqlslap: Cannot run query c1.sql,c2.sql ERROR : You have an error in your SQL 
syntax; check the manual that corresponds to your MySQL server version for the r
ight syntax to use near 'c1.sql,c2.sql' at line 1

~ $mysqlslap --create="c1.sql;c2.sql"
mysqlslap: Cannot run query c1.sql;c2.sql ERROR : You have an error in your SQL 
syntax; check the manual that corresponds to your MySQL server version for the r
ight syntax to use near 'c1.sql;c2.sql' at line 1
 
~ $mysqlslap --delimiter=";" --create="c1.sql;c2.sql"
mysqlslap: Cannot run query c1.sql ERROR : You have an error in your SQL syntax;
 check the manual that corresponds to your MySQL server version for the right sy
ntax to use near 'c1.sql' at line 1

~ $mysqlslap --create=c1.sql --create=c2.sql --query="select * from t1"
mysqlslap: Cannot run query select * from t1 ERROR : Table 'mysqlslap.t1' doesn't exist

~ $mysqlslap --create=c1.sql --query=c2.sql --query="select * from t2"
mysqlslap: Cannot run query select * from t2 ERROR : Table 'mysqlslap.t2' doesn't exist
[27 Mar 2006 13:30] Valeriy Kravchuk
Thank you for a problem report. Sorry, but where in documentation did you find something about multiple files? I see nothing similar at http://dev.mysql.com/doc/refman/5.1/en/mysqlslap.html:

"--create=value

The file or string to use for creating the table.
...

--query=value, -q value

The file or string containing the SELECT statement to use for retrieving data."
[11 Apr 2006 21:25] Magnus Blåudd
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

Try concatenating yout two files and the resulting file with mysqlslap. Or why not run two instances of mysqlslap from different hosts.