| 1 |
--source include/big_test.inc |
| 2 |
--source include/have_debug.inc |
| 3 |
--source include/have_binlog_format_row.inc |
| 4 |
|
| 5 |
RESET MASTER; |
| 6 |
CREATE TABLE t ( |
| 7 |
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, |
| 8 |
c2 INT, |
| 9 |
c3 DATETIME DEFAULT CURRENT_TIMESTAMP); |
| 10 |
|
| 11 |
--let $time_unit = 0.00001 |
| 12 |
--let $threads = 100 |
| 13 |
--let $iterations = 200 |
| 14 |
--let $n_tickets = 100 |
| 15 |
--expr $records = $threads * $iterations |
| 16 |
--expr $records = $records + $n_tickets |
| 17 |
--expr $sleep = $records * $time_unit |
| 18 |
|
| 19 |
--echo # Configuration: |
| 20 |
--echo # · MYSQL_SLAP theads: $threads |
| 21 |
--echo # · MYSQL_SLAP iterations: $iterations |
| 22 |
--echo # · BGC tickets: $n_tickets |
| 23 |
--echo # · Expected table count: $records |
| 24 |
--echo # · Sleep: $sleep |
| 25 |
|
| 26 |
exec_in_background $MYSQL_SLAP |
| 27 |
--silent |
| 28 |
--delimiter=";" |
| 29 |
--create-schema="test" |
| 30 |
-uroot |
| 31 |
--password="" |
| 32 |
--query="INSERT INTO t (c2) VALUES (0)" |
| 33 |
--concurrency=$threads |
| 34 |
--iterations=$iterations |
| 35 |
--commit=1; |
| 36 |
|
| 37 |
--let $debug_point = begin_new_bgc_ticket |
| 38 |
--let $debug_type = SESSION |
| 39 |
--source include/add_debug_point.inc |
| 40 |
|
| 41 |
--let $new_ticket = 0 |
| 42 |
while ($new_ticket != $n_tickets) { |
| 43 |
--disable_query_log |
| 44 |
--eval INSERT INTO t (c2) VALUES ($new_ticket + 1) |
| 45 |
--enable_query_log |
| 46 |
--inc $new_ticket |
| 47 |
--sleep $sleep |
| 48 |
} |
| 49 |
|
| 50 |
--source include/remove_debug_point.inc |
| 51 |
|
| 52 |
--let $wait_condition= SELECT COUNT(1) = $records FROM t |
| 53 |
--let $wait_timeout= 3000 |
| 54 |
--source include/wait_condition.inc |
| 55 |
|
| 56 |
DROP TABLE t; |
| 57 |
RESET MASTER; |