From 9b6930ec100057fdeb7e91d5dceb8a3afa308a32 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Wed, 20 Jul 2011 08:50:47 +0200 Subject: [PATCH] Bug#12756017 - PROFILING: SET_THD_PROC_INFO DOES NOT NEED TO CALL DIRNAME_LENGTH EACH TIME mysql-test/t/implicit_commit.test: Test fails if server is compiled with -DENABLED_PROFILING=0 sql/sql_class.cc: Let class PROFILING do its own handling of the input file name. sql/sql_profile.cc: Store only basename of file argument. --- mysql-test/t/implicit_commit.test | 1 + sql/sql_class.cc | 6 +++--- sql/sql_profile.cc | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mysql-test/t/implicit_commit.test b/mysql-test/t/implicit_commit.test index b10788bd891..59f8dc3a44c 100644 --- a/mysql-test/t/implicit_commit.test +++ b/mysql-test/t/implicit_commit.test @@ -1,5 +1,6 @@ source include/have_innodb.inc; source include/not_embedded.inc; +source include/have_profiling.inc; SET GLOBAL EVENT_SCHEDULER = OFF; SET BINLOG_FORMAT = STATEMENT; diff --git a/sql/sql_class.cc b/sql/sql_class.cc index dd8133835d3..1608b8c49ff 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -520,11 +520,11 @@ const char *set_thd_proc_info(void *thd_arg, const char *info, thd= current_thd; const char *old_info= thd->proc_info; - const char *basename= calling_file ? base_name(calling_file) : NULL; - DBUG_PRINT("proc_info", ("%s:%d %s", basename, calling_line, info)); + DBUG_PRINT("proc_info", ("%s:%d %s", calling_file, calling_line, info)); #if defined(ENABLED_PROFILING) - thd->profiling.status_change(info, calling_function, basename, calling_line); + thd->profiling.status_change(info, + calling_function, calling_file, calling_line); #endif thd->proc_info= info; return old_info; diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc index 6c398ca0cb5..5910833612a 100644 --- a/sql/sql_profile.cc +++ b/sql/sql_profile.cc @@ -294,7 +294,7 @@ void QUERY_PROFILE::new_status(const char *status_arg, DBUG_ASSERT(status_arg != NULL); if ((function_arg != NULL) && (file_arg != NULL)) - prof= new PROF_MEASUREMENT(this, status_arg, function_arg, file_arg, line_arg); + prof= new PROF_MEASUREMENT(this, status_arg, function_arg, base_name(file_arg), line_arg); else prof= new PROF_MEASUREMENT(this, status_arg);