summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2011-12-29 19:37:26 +0100
committerVladislav Vaintroub <wlad@montyprogram.com>2011-12-29 19:37:26 +0100
commit539a7ebe1038560c8de1d521120058907f2604bf (patch)
treecd9012c1cab24b7746cd9c2f8b091a9f2f145f76 /sql/sql_class.cc
parent8d90582a3b36ae8be764b43043fedd03c3db4686 (diff)
downloadmariadb-git-539a7ebe1038560c8de1d521120058907f2604bf.tar.gz
LP909537: Ensure thd_wait_begin/thd_wait_end callbacks are called.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc26
1 files changed, 9 insertions, 17 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index edb7fe6c71e..cd29d706823 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -3927,9 +3927,7 @@ extern "C" bool thd_sqlcom_can_generate_row_events(const MYSQL_THD thd)
return sqlcom_can_generate_row_events(thd);
}
-#ifdef NOT_USED /* we'll do the correctly instead */
-extern "C" void thd_pool_wait_begin(MYSQL_THD thd, int wait_type);
-extern "C" void thd_pool_wait_end(MYSQL_THD thd);
+
/*
Interface for MySQL Server, plugins and storage engines to report
@@ -3954,7 +3952,10 @@ extern "C" void thd_pool_wait_end(MYSQL_THD thd);
*/
extern "C" void thd_wait_begin(MYSQL_THD thd, int wait_type)
{
- MYSQL_CALLBACK(thd->scheduler, thd_wait_begin, (thd, wait_type));
+ if(!thd)
+ thd= current_thd;
+ if (thd)
+ MYSQL_CALLBACK(thd->scheduler, thd_wait_begin, (thd, wait_type));
}
/**
@@ -3965,21 +3966,12 @@ extern "C" void thd_wait_begin(MYSQL_THD thd, int wait_type)
*/
extern "C" void thd_wait_end(MYSQL_THD thd)
{
- MYSQL_CALLBACK(thd->scheduler, thd_wait_end, (thd));
-}
-#else
-extern "C" void thd_wait_begin(MYSQL_THD thd, int wait_type)
-{
- /* do NOTHING for the embedded library */
- return;
+ if(!thd)
+ thd= current_thd;
+ if (thd)
+ MYSQL_CALLBACK(thd->scheduler, thd_wait_end, (thd));
}
-extern "C" void thd_wait_end(MYSQL_THD thd)
-{
- /* do NOTHING for the embedded library */
- return;
-}
-#endif
#endif // INNODB_COMPATIBILITY_HOOKS */
/****************************************************************************