2
# Bug#24289 Status Variable "Questions" gets wrong values with Stored Routines
5
CREATE FUNCTION testQuestion() RETURNS INTEGER
13
CREATE PROCEDURE testQuestion2()
17
DROP TABLE IF EXISTS t1,t2;
18
CREATE TABLE t1 (c1 INT);
19
CREATE TABLE t2 (c1 INT);
20
CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND
21
DO INSERT INTO t1 VALUES(1);
23
SHOW STATUS LIKE 'Questions';
26
SELECT testQuestion();
30
SHOW STATUS LIKE 'Questions';
36
Assert Questions == 11
37
SHOW STATUS LIKE 'Questions';
43
Assert Questions == 13
44
SHOW STATUS LIKE 'Questions';
50
Assert Questions == 14
51
SHOW STATUS LIKE 'Questions';
54
CREATE TRIGGER trigg1 AFTER INSERT ON t1
56
INSERT INTO t2 VALUES (1);
59
Assert Questions == 16
60
SHOW STATUS LIKE 'Questions';
63
INSERT INTO t1 VALUES (1);
64
Assert Questions == 18
65
SHOW STATUS LIKE 'Questions';
68
DROP PROCEDURE testQuestion2;
70
DROP FUNCTION testQuestion;