Bug #68817 mysqlslap documentation badly flawed/incomplete
Submitted: 29 Mar 2013 23:40 Modified: 1 Apr 2013 19:58
Reporter: Kolbe Kegel Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.5.30 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any
Tags: mysqlslap

[29 Mar 2013 23:40] Kolbe Kegel
Description:
The mysqlslap documentation at http://dev.mysql.com/doc/refman/5.5/en//mysqlslap.html#option_mysqlslap_create-and-drop-sc... contains reference to a --create-and-drop-schema option, but no such option exists in the source code for MySQL 5.5.30 or in the tool distributed with MySQL 5.5.30:

mysql-5.5.30 $ grep -r 'create[-_]and[-_]drop' *
Docs/mysql.info:-create-and-drop-schema=valuecreate-and-drop-schemaThe schema in which to run    5.5.12
Docs/mysql.info:   *  `--create-and-drop-schema=VALUE'
Docs/mysql.info:     run. To avoid this, use the `--create-and-drop-schema' option
Docs/mysql.info:* create-and-drop-schema option, mysqlslap: mysqlslap.       (line  277)
Docs/mysql.info:* mysqlslap, create-and-drop-schema option: mysqlslap.       (line  277)
Docs/mysql.info:Ref: option_mysqlslap_create-and-drop-schema950380
man/mysqlslap.1:.\" mysqlslap: create-and-drop-schema option
man/mysqlslap.1:.\" create-and-drop-schema option: mysqlslap

5.5 $ mysqlslap --create-and-drop-schema=test
mysqlslap: unknown variable 'create-and-drop-schema=test'

Furthermore, the mysqlslap tool *does* have a --no-drop option that isn't mentioned on http://dev.mysql.com/doc/refman/5.5/en//mysqlslap.html#option_mysqlslap_create-and-drop-sc... at all:

5.5 $ mysqlslap --help | grep no.drop
  --no-drop           Do not drop the schema after the test.

  {"no-drop", OPT_SLAP_NO_DROP, "Do not drop the schema after the test.",
   &opt_no_drop, &opt_no_drop, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},

How to repeat:
Try using --create-and-drop-schema with mysqlslap.

Note that --no-drop does not exist in mysqlslap documentation.

Suggested fix:
The documentation for mysqlslap should be carefully reviewed to address these concerns and other likely deficiencies.
[1 Apr 2013 14:46] MySQL Verification Team
Seems like the fix for http://bugs.mysql.com/bug.php?id=58090 meant to add this, but that changeset didn't really!
[1 Apr 2013 16:01] Nirbhay Choubey
Looks like the previous (unapproved) version of the committed
patch was referenced to produce the docs' changelog.

The approved patch that actually went into the main code
introduced --no-drop (as rightly pointed by Kolbe) :
http://lists.mysql.com/commits/134382
[1 Apr 2013 19:51] Paul DuBois
Corrected changelog entry for Bug#58090:

When invoked with the --auto-generate-sql option, mysqlslap dropped
the schema specified with the --create-schema option at the end of 
the test run, which may have been unexpected by the user. mysqlslap
now has a --no-drop option that prevents any schema created during
the test run from being dropped.
[1 Apr 2013 19:58] 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.

Kolbe, good catch!