summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/perfschema/include/program_execution.inc
blob: f774a4d7b50d31f4dde95d81d3296ed28b1cab43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#
# Execute the stored programs created in 
# suite/perfschema/include/program_setup.inc 
#

--echo #####################
--echo # Executing queries #
--echo #####################
INSERT INTO t1 VALUES (10,20);
CALL SampleProc1(30,40,50);
SET @a=1;
SELECT @a;
CALL SampleProc2("Jwalamukhi",34);
SELECT @a;
CALL SampleProc3();
CALL SampleProc4();
SET @change=1;
SELECT @change;
UPDATE t2 SET id=22 WHERE name="Jwalamukhi";
SELECT @change;
SET @del=1;
SELECT @del;
DELETE FROM t1 WHERE i=76;
SELECT @del;
SELECT wt_avg(1, 12, 1990, 1121990);
SELECT fac(5);
SELECT append("Bolly", "wood");

--echo # Event

SET GLOBAL event_scheduler=ON;

CREATE TABLE table_t(a INT);
DELIMITER |;
CREATE EVENT e1 ON SCHEDULE EVERY 2 SECOND ON COMPLETION NOT PRESERVE DO
BEGIN
  INSERT INTO table_t VALUES(1);
END|
DELIMITER ;|

# Let e1 insert 1 record into the table table_t

--let $wait_condition= select count(*) = 1 from table_t
--source include/wait_condition.inc
SELECT * FROM table_t;

# Wait till the  above one execution of event is instrumented.

--let $wait_condition= select count(*) = 1 from performance_schema.events_statements_history_long where object_type='EVENT' 
--source include/wait_condition.inc 

SET GLOBAL event_scheduler=OFF;
--source include/no_running_event_scheduler.inc