Bug #58090 mysqlslap drops schema specified in create_schema if auto-generate-sql also set
Submitted: 9 Nov 2010 19:04 Modified: 27 Apr 2011 18:35
Reporter: Sveta Smirnova Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.1, all OS:Any
Assigned to: CPU Architecture:Any

[9 Nov 2010 19:04] Sveta Smirnova
Description:
If mysqlslap runs with option auto-generate-sql it drops schema specified by create-schema option.

This is very bad if user occasionally uses existent schema.

How to repeat:
$mysql51 -e "create database bug"

$mysql51 bug -e "create table t1(f1 int);"

$/Users/apple/Applications/mysql-5.1/bin/mysqlslap  --socket=/tmp/mysql51.sock -uroot --create_schema=bug  --auto-generate-sql 
Benchmark
        Average number of seconds to run all queries: 0.011 seconds
        Minimum number of seconds to run all queries: 0.011 seconds
        Maximum number of seconds to run all queries: 0.011 seconds
        Number of clients running queries: 1
        Average number of queries per client: 0

$mysql51 bug
ERROR 1049 (42000): Unknown database 'bug'

Suggested fix:
At least document this
[27 Apr 2011 18:35] Paul DuBois
Noted in 5.1.57, 5.5.12, 5.6.3 changelogs.

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
no longer drops the schema, but has a new --create-and-drop schema
that both creates and drops a schema.

CHANGESET - http://lists.mysql.com/commits/135019
[1 Apr 2013 19:50] Paul DuBois
Corrected changelog entry:

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.