summaryrefslogtreecommitdiff
path: root/mysql-test/r/profiling.result
diff options
context:
space:
mode:
authorunknown <cmiller@zippy.cornsilk.net>2007-11-13 09:46:17 -0500
committerunknown <cmiller@zippy.cornsilk.net>2007-11-13 09:46:17 -0500
commit7eb9aac77e69e0bce9234958b50dde38140007a8 (patch)
treea965c70fa22a2751eacbcde6ec95b4fb00f7d2a8 /mysql-test/r/profiling.result
parentac180f8272f9be0cf2621c11e03e313b891c4417 (diff)
downloadmariadb-git-7eb9aac77e69e0bce9234958b50dde38140007a8.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. mysql-test/r/profiling.result: Show that each query inside a procedure is profiled separately. mysql-test/t/profiling.test: Show that each query inside a procedure is profiled separately. sql/sp_head.cc: Poke profiling into stored-procedure code. For statement parts only of routines, process them as profilable discrete queries. sql/sql_profile.cc: Encode decimal size correctly.
Diffstat (limited to 'mysql-test/r/profiling.result')
-rw-r--r--mysql-test/r/profiling.result94
1 files changed, 94 insertions, 0 deletions
diff --git a/mysql-test/r/profiling.result b/mysql-test/r/profiling.result
index 6435b346f98..1673597d544 100644
--- a/mysql-test/r/profiling.result
+++ b/mysql-test/r/profiling.result
@@ -300,6 +300,100 @@ id
select @@profiling;
@@profiling
1
+set session profiling = OFF;
+drop table if exists profile_log;
+Warnings:
+Note 1051 Unknown table 'profile_log'
+create table profile_log (how_many int);
+drop procedure if exists p1;
+drop procedure if exists p2;
+drop procedure if exists p3;
+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//
+select count(*) as count_before_p1 from information_schema.profiling;
+count_before_p1
+535
+first call to p1
+call p1;
+This p1 should show up in profiling
+This p1 should show up in profiling
+select * from profile_log;
+how_many
+528
+second call to p1
+call p1;
+This p1 should show up in profiling
+This p1 should show up in profiling
+select * from profile_log;
+how_many
+528
+478
+third call to p1
+call p1;
+This p1 should show up in profiling
+This p1 should show up in profiling
+select * from profile_log;
+how_many
+528
+478
+443
+set session profiling = OFF;
+call p2;
+This p1 should show up in profiling
+This p1 should show up in profiling
+This p2 should show up in profiling
+This p2 should show up in profiling
+set session profiling = OFF;
+call p3;
+This p3 should show up in profiling
+This p3 should show up in profiling
+Status Duration
+continuing inside routine #
+checking permissions #
+Opening tables #
+init #
+optimizing #
+executing #
+end #
+query end #
+closing tables #
+show profiles;
+Query_ID Duration Query
+# # create table t3 (id int not null primary key)
+# # insert into t1 values (1), (2), (3)
+# # insert into t2 values (1), (2), (3)
+# # insert into t3 values (1), (2), (3)
+# # select * from t1
+# # delete from t1
+# # insert into t1 values (1), (2), (3)
+# # insert into t1 values (1), (2), (3)
+# # select * from t1
+# # select @@profiling
+# # create function f1() returns varchar(50) return 'hello'
+# # select @@profiling
+# # select @@profiling
+# # select 'This p1 should show up in profiling'
+# # insert into profile_log select count(*) from information_schema.profiling
+# # select * from profile_log
+# # SET profiling = ON
+# # select 'This p1 should show up in profiling'
+# # insert into profile_log select count(*) from information_schema.profiling
+# # select * from profile_log
+# # SET profiling = ON
+# # select 'This p1 should show up in profiling'
+# # insert into profile_log select count(*) from information_schema.profiling
+# # select * from profile_log
+# # SET profiling = ON
+# # select 'This p1 should show up in profiling'
+# # insert into profile_log select count(*) from information_schema.profiling
+# # select 'This p2 should show up in profiling'
+# # select 'This p3 should show up in profiling'
+# # show profile
+drop procedure if exists p1;
+drop procedure if exists p2;
+drop procedure if exists p3;
+drop table if exists profile_log;
set session profiling = ON;
drop table if exists t2;
create table t2 (id int not null);