diff options
author | unknown <knielsen@knielsen-hq.org> | 2010-04-28 14:52:24 +0200 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2010-04-28 14:52:24 +0200 |
commit | 11fe627e3f0ecf45abdb49f3b92cca88b12465e7 (patch) | |
tree | bb1fdd7363fbf2580572ac9a56dbd4c933cc4c0d /sql/debug_sync.cc | |
parent | c805d9bc0b127e1126eeb7814d5ff5d66a539b47 (diff) | |
parent | ba192d38bda55ac8b2cf3ccc5a6338e053ccddb1 (diff) | |
download | mariadb-git-11fe627e3f0ecf45abdb49f3b92cca88b12465e7.tar.gz |
Merge MySQL 5.1.46 into MariaDB.mariadb-merge-mysql-5.1.46
Still two test failures to be solved: main.myisam and main.subselect.
Diffstat (limited to 'sql/debug_sync.cc')
-rw-r--r-- | sql/debug_sync.cc | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc index 2580d526b52..23a649a89fa 100644 --- a/sql/debug_sync.cc +++ b/sql/debug_sync.cc @@ -1903,4 +1903,42 @@ void debug_sync(THD *thd, const char *sync_point_name, size_t name_len) DBUG_VOID_RETURN; } +/** + Define debug sync action. + + @param[in] thd thread handle + @param[in] action_str action string + + @return status + @retval FALSE ok + @retval TRUE error + + @description + The function is similar to @c debug_sync_eval_action but is + to be called immediately from the server code rather than + to be triggered by setting a value to DEBUG_SYNC system variable. + + @note + The input string is copied prior to be fed to + @c debug_sync_eval_action to let the latter modify it. + + Caution. + The function allocates in THD::mem_root and therefore + is not recommended to be deployed inside big loops. +*/ + +bool debug_sync_set_action(THD *thd, const char *action_str, size_t len) +{ + bool rc; + char *value; + DBUG_ENTER("debug_sync_set_action"); + DBUG_ASSERT(thd); + DBUG_ASSERT(action_str); + + value= strmake_root(thd->mem_root, action_str, len); + rc= debug_sync_eval_action(thd, value); + DBUG_RETURN(rc); +} + + #endif /* defined(ENABLED_DEBUG_SYNC) */ |