File: status2.test

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (80 lines) | stat: -rw-r--r-- 1,848 bytes parent folder | download | duplicates (2)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
--source include/not_embedded.inc

--echo #
--echo # Bug#24289 Status Variable "Questions" gets wrong values with Stored Routines
--echo #
--disable_ps2_protocol
FLUSH STATUS;
DELIMITER $$;
CREATE FUNCTION testQuestion() RETURNS INTEGER
BEGIN
  DECLARE foo INTEGER;
  DECLARE bar INTEGER;
  SET foo=1;
  SET bar=2;
  RETURN foo;
END $$
CREATE PROCEDURE testQuestion2()
BEGIN
  SELECT 1;
END $$
DELIMITER ;$$
--disable_warnings
DROP TABLE IF EXISTS t1,t2;
CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND
  DO INSERT INTO t1 VALUES(1);
--enable_warnings
CREATE TABLE t1 (c1 INT);
CREATE TABLE t2 (c1 INT);

--disable_cursor_protocol
--echo Assert Questions == 7
SHOW STATUS LIKE 'Questions';
SELECT testQuestion();
--echo Assert Questions == 9
SHOW STATUS LIKE 'Questions';
CALL testQuestion2();
--echo Assert Questions == 11
SHOW STATUS LIKE 'Questions';
SELECT 1;
--echo Assert Questions == 13
SHOW STATUS LIKE 'Questions';
--enable_cursor_protocol
connect (con1,localhost,root,,);
connection con1;
SELECT 1;
connection default;
disconnect con1;
--echo Assert Questions == 14
SHOW STATUS LIKE 'Questions';
DELIMITER $$;
CREATE TRIGGER trigg1 AFTER INSERT ON t1
  FOR EACH ROW BEGIN
   INSERT INTO t2 VALUES (1);
  END;
$$
DELIMITER ;$$
--echo Assert Questions == 16
SHOW STATUS LIKE 'Questions';
INSERT INTO t1 VALUES (1);
--echo Assert Questions == 18
SHOW STATUS LIKE 'Questions';
# TODO: Uncomment the lines below when FLUSH GLOBAL STATUS is implemented.
# FLUSH STATUS;
# SHOW GLOBAL STATUS LIKE 'Questions';
DROP PROCEDURE testQuestion2;
DROP TRIGGER trigg1;
DROP FUNCTION testQuestion;
DROP EVENT ev1;
DROP TABLE t1,t2;
--enable_ps2_protocol

--echo #
--echo # End of 5.5 tests
--echo #

select variable_value < 1024*1024*1024 from information_schema.global_status where variable_name='memory_used';

--echo #
--echo # End of 10.2 tests
--echo #