Description:
mysqlslap is not using the tables it creates in the schema specified on the command line. Instead it is using the default 'mysqlslap' schema (and complains if it doesn't exist).
The schema specified in the command line is created but not used as shown below:
----Running mysqlslap:
omer@linux:~/source/src51_1230/client> ./mysqlslap --socket=/home/omer/source/src51_1230/mysql-test/var/tmp/master.sock --user=root --create="create table t1 (f1 int)" --data="insert into t1 values (42)" --repeat-data=1 --concurrency-load=1 --engine="myisam" --create-schema="omer" --preserve-schema-exit
Running for engine myisam
/home/omer/source/src51_1230/client/.libs/lt-mysqlslap: Unknown database 'mysqlslap'
Seconds to load data: 0.00247
Number of clients loading data: 1
Number of inserts per client: 1
>>> Complaining about the 'mysqlslap' not being there although needs to use 'omer'
----Creating the database using the mysql client:
mysql>
mysql> create database mysqlslap;
Query OK, 1 row affected (0.00 sec)
---Trying again:
omer@linux:~/source/src51_1230/client> ./mysqlslap --socket=/home/omer/source/src51_1230/mysql-test/var/tmp/master.sock --user=root --create="create table t1 (f1 int)" --data="insert into t1 values (42)" --repeat-data=1 --concurrency-load=1 --engine="myisam" --create-schema="omer" --preserve-schema-exit
Running for engine myisam
/home/omer/source/src51_1230/client/.libs/lt-mysqlslap: Cannot run query insert into t1 values (42) ERROR : Table 'mysqlslap.t1' doesn't exist
Seconds to load data: 0.01573
Number of clients loading data: 1
Number of inserts per client: 1
>>> Now complains about the table
--- Adding the table from mysql
mysql> use mysqlslap;
Database changed
mysql> create table t1 (f1 int);
Query OK, 0 rows affected (0.02 sec)
--- Now seems to run:
omer@linux:~/source/src51_1230/client> ./mysqlslap --socket=/home/omer/source/src51_1230/mysql-test/var/tmp/master.sock --user=root --create="create table t1 (f1 int)" --data="insert into t1 values (42)" --repeat-data=1 --concurrency-load=1 --engine="myisam" --create-schema="omer" --preserve-schema-exit
Running for engine myisam
Seconds to load data: 0.00499
Number of clients loading data: 1
Number of inserts per client: 1
omer@linux:~/source/src51_1230/client>
--- Checking from mysql:
mysql> select count(*) from mysqlslap.t1;
+----------+
| count(*) |
+----------+
| 1 |
+----------+
1 row in set (0.00 sec)
mysql> select count(*) from omer.t1;
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.00 sec)
mysql>
>>> So the program creates the schema and the table specified on the command line but does not use it!
How to repeat:
Follow the above steps
Suggested fix:
Have the program use the schema specified on the command line