1--source include/have_rocksdb.inc
2--source include/big_test.inc
3
4#
5# Generate concurrent requests to alter a table using mysqlslap
6#
7set @orig_max_connections=@@global.max_connections;
8set @@global.max_connections=500;
9
10CREATE DATABASE mysqlslap;
11
12use mysqlslap;
13
14CREATE TABLE a1 (a int, b int) ENGINE=ROCKSDB;
15INSERT INTO a1 VALUES (1, 1);
16
17--write_file $MYSQL_TMP_DIR/concurrent_alter.sh
18$MYSQL_SLAP --silent --delimiter=";" --query="alter table a1 add index bx(b); alter table a1 drop index bx" --concurrency=1 --iterations=25 &
19$MYSQL_SLAP --silent --delimiter=";" --query="alter table a1 add index ax(a); alter table a1 drop index ax" --concurrency=1 --iterations=25 &
20sleep 2
21$MYSQL_SLAP --silent --delimiter=";" --query="select * from a1 where a=1" --concurrency=16 --iterations=1000 &
22$MYSQL_SLAP --silent --delimiter=";" --query="select * from a1 where b=1" --concurrency=16 --iterations=1000
23sleep 2
24$MYSQL_SLAP --silent --delimiter=";" --query="select * from a1 where a=1" --concurrency=16 --iterations=1000 &
25$MYSQL_SLAP --silent --delimiter=";" --query="select * from a1 where b=1" --concurrency=16 --iterations=1000
26wait
27EOF
28
29--exec bash $MYSQL_TMP_DIR/concurrent_alter.sh
30
31SHOW CREATE TABLE a1;
32
33--remove_file $MYSQL_TMP_DIR/concurrent_alter.sh
34
35DROP DATABASE mysqlslap;
36
37set @@global.max_connections=@orig_max_connections;
38