Bug #50855 [mysqlslap] document that --number-of-queries honors --delimiter
Submitted: 2 Feb 2010 20:40 Modified: 4 Feb 2010 21:16
Reporter: Andrii Nikitin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.1.43 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any

[2 Feb 2010 20:40] Andrii Nikitin
Description:
Please document that mysqlslap parameter --number-of-queries honors --delimiter (default '\n')

This may take much time to understand that following request will insert only 5 rows

mysqlslap --query="use test; insert into t values(null)" --number-of-queries=10 --delimiter=';'

How to repeat:
run following script

mysql test -e "drop table if exists t; create table t (i int);"
mysql -e "SHOW GLOBAL STATUS" | grep -m1 Com_insert
mysqlslap --query="use test; insert into t values(null)" --number-of-queries=10 -s --create-schema=test
mysql -e "SHOW GLOBAL STATUS" | grep -m1 Com_insert
mysqlslap --query="use test; insert into t values(null)" --number-of-queries=10 -s --delimiter=';' --create-schema=test
mysql -e "SHOW GLOBAL STATUS" | grep -m1 Com_insert

Suggested fix:
please document something like:

--number-of-queries=N

Limit each client to approximately this number of queries. 
This option takes into account --delimiter: each statement from --query parameter delimited using --delimiter will be counted.
This option was added in MySQL 5.1.5.
[4 Feb 2010 21:16] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.

Updated description:

Limit each client to approximately this many queries. Query counting
takes into account the statement delimiter. For example, if you
invoke mysqlslap as follows, the ; delimiter is recognized so that
each instance of the query string counts as two queries. As a result,
5 rows (not 10) are inserted.

shell> mysqlslap --delimiter=";" --number-of-queries=10
         --query="use test;insert into t values(null)"