summaryrefslogtreecommitdiff
path: root/mysql-test/t/profiling.test
diff options
context:
space:
mode:
authorcmiller@zippy.cornsilk.net <>2007-11-13 09:46:17 -0500
committercmiller@zippy.cornsilk.net <>2007-11-13 09:46:17 -0500
commitd27fb9f93922b1bc41516df25d377b7d77aad497 (patch)
treea965c70fa22a2751eacbcde6ec95b4fb00f7d2a8 /mysql-test/t/profiling.test
parent5626ec5733ee6d33ddbd4c02ff3788a79098b27b (diff)
downloadmariadb-git-d27fb9f93922b1bc41516df25d377b7d77aad497.tar.gz
Insert profiling instructions into s-p code to make each statement
be profiled separately. Expand the time formats in i_s.profiling to wide enough for larger numbers.
Diffstat (limited to 'mysql-test/t/profiling.test')
-rw-r--r--mysql-test/t/profiling.test42
1 files changed, 41 insertions, 1 deletions
diff --git a/mysql-test/t/profiling.test b/mysql-test/t/profiling.test
index 9e73c63a977..9e5328e030f 100644
--- a/mysql-test/t/profiling.test
+++ b/mysql-test/t/profiling.test
@@ -138,7 +138,7 @@ show profiles;
## Verify that the various juggling of THD contexts doesn't affect profiling.
-## Functions
+## Functions and procedures
set session profiling = ON;
select @@profiling;
create function f1() returns varchar(50) return 'hello';
@@ -146,6 +146,46 @@ select @@profiling;
select * from t1 where id <> f1();
select @@profiling;
+set session profiling = OFF;
+drop table if exists profile_log;
+create table profile_log (how_many int);
+
+--disable_warnings
+drop procedure if exists p1;
+drop procedure if exists p2;
+drop procedure if exists p3;
+--enable_warnings
+
+delimiter //;
+create procedure p1 () modifies sql data begin set profiling = ON; select 'This p1 should show up in profiling'; insert into profile_log select count(*) from information_schema.profiling; end//
+create procedure p2() deterministic begin set profiling = ON; call p1(); select 'This p2 should show up in profiling'; end//
+create procedure p3 () reads sql data begin set profiling = ON; select 'This p3 should show up in profiling'; show profile; end//
+delimiter ;//
+
+select count(*) as count_before_p1 from information_schema.profiling;
+--echo first call to p1
+call p1;
+select * from profile_log;
+--echo second call to p1
+call p1;
+select * from profile_log;
+--echo third call to p1
+call p1;
+select * from profile_log;
+set session profiling = OFF;
+call p2;
+set session profiling = OFF;
+--replace_column 2 #
+call p3;
+
+--replace_column 1 # 2 #
+show profiles;
+
+drop procedure if exists p1;
+drop procedure if exists p2;
+drop procedure if exists p3;
+drop table if exists profile_log;
+
## Triggers
set session profiling = ON;
drop table if exists t2;