2
--echo # Bug#24289 Status Variable "Questions" gets wrong values with Stored Routines
6
CREATE FUNCTION testQuestion() RETURNS INTEGER
14
CREATE PROCEDURE testQuestion2()
20
DROP TABLE IF EXISTS t1,t2;
22
CREATE TABLE t1 (c1 INT);
23
CREATE TABLE t2 (c1 INT);
24
CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND
25
DO INSERT INTO t1 VALUES(1);
27
--echo Assert Questions == 7
28
SHOW STATUS LIKE 'Questions';
29
SELECT testQuestion();
30
--echo Assert Questions == 9
31
SHOW STATUS LIKE 'Questions';
33
--echo Assert Questions == 11
34
SHOW STATUS LIKE 'Questions';
36
--echo Assert Questions == 13
37
SHOW STATUS LIKE 'Questions';
38
connect (con1,localhost,root,,);
43
--echo Assert Questions == 14
44
SHOW STATUS LIKE 'Questions';
46
CREATE TRIGGER trigg1 AFTER INSERT ON t1
48
INSERT INTO t2 VALUES (1);
52
--echo Assert Questions == 16
53
SHOW STATUS LIKE 'Questions';
54
INSERT INTO t1 VALUES (1);
55
--echo Assert Questions == 18
56
SHOW STATUS LIKE 'Questions';
57
# TODO: Uncomment the lines below when FLUSH GLOBAL STATUS is implemented.
59
# SHOW GLOBAL STATUS LIKE 'Questions';
60
DROP PROCEDURE testQuestion2;
62
DROP FUNCTION testQuestion;
65
--echo End of 6.0 tests