1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Bug#41131 "Questions" fails to increment - ignores statements instead stored procs(5.0 ver)

Added global status variable 'Queries' which represents
total amount of queries executed by server including
statements executed by SPs.
note: It's old behaviour of 'Questions' variable.


mysql-test/r/status.result:
  test result
mysql-test/t/status.test:
  test case
sql/mysqld.cc:
  Added global status variable 'Queries' which represents
  total amount of queries executed by server including
  statements executed by SPs.
  note: It's old behaviour of 'Questions' variable.
sql/sql_show.cc:
  Added global status variable 'Queries' which represents
  total amount of queries executed by server including
  statements executed by SPs.
  note: It's old behaviour of 'Questions' variable.
sql/structs.h:
  Added global status variable 'Queries' which represents
  total amount of queries executed by server including
  statements executed by SPs.
  note: It's old behaviour of 'Questions' variable.
This commit is contained in:
Sergey Glukhov
2008-12-29 16:06:53 +04:00
parent ce985aa36e
commit 3b617acb87
5 changed files with 66 additions and 1 deletions

View File

@ -91,3 +91,28 @@ SHOW SESSION STATUS LIKE 'Last_query_cost';
Variable_name Value
Last_query_cost 4.805836
DROP TABLE t1;
DROP PROCEDURE IF EXISTS p1;
DROP FUNCTION IF EXISTS f1;
CREATE FUNCTION f1() RETURNS INTEGER
BEGIN
DECLARE foo INTEGER;
DECLARE bar INTEGER;
SET foo=1;
SET bar=2;
RETURN foo;
END $$
CREATE PROCEDURE p1()
BEGIN
SELECT 1;
END $$
SELECT f1();
f1()
1
CALL p1();
1
1
SELECT 9;
9
9
DROP PROCEDURE p1;
DROP FUNCTION f1;

View File

@ -171,4 +171,40 @@ SHOW SESSION STATUS LIKE 'Last_query_cost';
DROP TABLE t1;
#
# Bug#41131 "Questions" fails to increment - ignores statements instead stored procs
#
connect (con1,localhost,root,,);
connection con1;
--disable_warnings
DROP PROCEDURE IF EXISTS p1;
DROP FUNCTION IF EXISTS f1;
--enable_warnings
DELIMITER $$;
CREATE FUNCTION f1() RETURNS INTEGER
BEGIN
DECLARE foo INTEGER;
DECLARE bar INTEGER;
SET foo=1;
SET bar=2;
RETURN foo;
END $$
CREATE PROCEDURE p1()
BEGIN
SELECT 1;
END $$
DELIMITER ;$$
let $org_queries= `SHOW STATUS LIKE 'Queries'`;
SELECT f1();
CALL p1();
let $new_queries= `SHOW STATUS LIKE 'Queries'`;
--disable_log
let $diff= `SELECT SUBSTRING('$new_queries',9)-SUBSTRING('$org_queries',9)`;
--enable_log
eval SELECT $diff;
disconnect con1;
connection default;
DROP PROCEDURE p1;
DROP FUNCTION f1;
# End of 5.0 tests