Commit 0f50bfa4 authored by brian@zim.tangent.org's avatar brian@zim.tangent.org

Fixed bug #16167

Added --use-threads option for porting to Windows. 
parent efd00c65
...@@ -982,6 +982,7 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit) ...@@ -982,6 +982,7 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
} }
else else
{ {
fflush(NULL);
for (x= 0; x < concur; x++) for (x= 0; x < concur; x++)
{ {
int pid; int pid;
...@@ -1026,10 +1027,19 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit) ...@@ -1026,10 +1027,19 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
gettimeofday(&start_time, NULL); gettimeofday(&start_time, NULL);
my_close(lock_file, MYF(0)); /*
We look to grab a write lock at this point. Once we get it we know that
all clients have completed their work.
*/
if (opt_use_threads) if (opt_use_threads)
{ {
if (my_lock(lock_file, F_WRLCK, 0, F_TO_EOF, MYF(0)))
{
fprintf(stderr,"%s: Could not get lockfile\n",
my_progname);
exit(0);
}
my_lock(lock_file, F_UNLCK, 0, F_TO_EOF, MYF(0));
} }
else else
{ {
...@@ -1043,6 +1053,8 @@ WAIT: ...@@ -1043,6 +1053,8 @@ WAIT:
} }
gettimeofday(&end_time, NULL); gettimeofday(&end_time, NULL);
my_close(lock_file, MYF(0));
sptr->timing= timedif(end_time, start_time); sptr->timing= timedif(end_time, start_time);
sptr->users= concur; sptr->users= concur;
sptr->rows= limit; sptr->rows= limit;
......
This diff is collapsed.
...@@ -19,6 +19,5 @@ innodb_concurrent : Results are not deterministic, Elliot will fix (BUG#3300) ...@@ -19,6 +19,5 @@ innodb_concurrent : Results are not deterministic, Elliot will fix (BUG#3300)
subselect : Bug#15706 subselect : Bug#15706
type_time : Bug#15805 type_time : Bug#15805
rpl_ddl : Bug#15963 SBR does not show "Definer" correctly rpl_ddl : Bug#15963 SBR does not show "Definer" correctly
mysqlslap : Bug#16167
events : Affects flush test case. A table lock not released somewhere events : Affects flush test case. A table lock not released somewhere
rpl_sp : Bug #16456 rpl_sp : Bug #16456
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql
--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --use-threads
--exec $MYSQL_SLAP --only-print --iterations=20 --query="select * from t1" --create="CREATE TABLE t1 (id int, name varchar(64)); INSERT INTO t1 VALUES (1, 'This is a test')" --delimiter=";" --exec $MYSQL_SLAP --only-print --iterations=20 --query="select * from t1" --create="CREATE TABLE t1 (id int, name varchar(64)); INSERT INTO t1 VALUES (1, 'This is a test')" --delimiter=";"
--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --query="select * from t1" --create="CREATE TABLE t1 (id int, name varchar(64)); INSERT INTO t1 VALUES (1, 'This is a test')" --delimiter=";" --exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --query="select * from t1" --create="CREATE TABLE t1 (id int, name varchar(64)); INSERT INTO t1 VALUES (1, 'This is a test')" --delimiter=";"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment