1if (`SELECT VERSION() LIKE '%embedded%'`)
2{
3   --skip This test cannot run with the embedded server.
4}
5
6--source suite/perfschema_stress/include/settings.inc
7
8--disable_query_log
9--disable_result_log
10
11if (!$engine_type) {
12  let $engine_type= $default_engine_type;
13}
14if ($engine_type == Falcon) {
15  --source include/have_falcon.inc
16}
17
18--replace_result $engine_type <engine_type>
19eval CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value')
20     ENGINE=$engine_type;
21
22# Need something to start with
23INSERT INTO t1(id) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
24
25# Bulk load the correct number of rows
26while (`SELECT MAX(id) < $num_stress_rows FROM t1`)
27{
28   SELECT MAX(id) FROM t1 INTO @max;
29--replace_result $num_stress_rows <num_stress_rows>
30   eval INSERT INTO t1(id) SELECT id + @max FROM t1
31        WHERE id + @max <= $num_stress_rows;
32}
33
34# Turn on some instruments
35
36UPDATE performance_schema.setup_instruments SET TIMED = 'YES';
37
38UPDATE performance_schema.setup_instruments SET ENABLED = 'NO';
39UPDATE performance_schema.setup_instruments SET ENABLED = 'YES'
40WHERE NAME IN ('wait/io/file/sql/FRM',
41               'thread/sql/Connection',
42               'wait/synch/cond/sql/COND_mdl',
43               'wait/synch/rwlock/sql/LOCK_sys_init_connect',
44               'wait/synch/mutex/sql/LOCK_mdl');
45
46UPDATE performance_schema.setup_consumers SET ENABLED = 'YES';
47
48--enable_result_log
49--enable_query_log
50