diff options
author | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-03-22 16:28:51 +0300 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-03-22 16:28:51 +0300 |
commit | 074583a730d62d616061f06e810c0dfdf4aeddcc (patch) | |
tree | 1fef9d45dab47fa4d783abace538a791c958b006 /sql/debug_sync.cc | |
parent | 5d407d0c1aa8a7cb5f18a5a26cb517f8b4eb84fa (diff) | |
parent | a35418784bc35f5b6c461689c954bdcfbb4c9b33 (diff) | |
download | mariadb-git-074583a730d62d616061f06e810c0dfdf4aeddcc.tar.gz |
Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:
Text conflict in mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
Text conflict in sql/item_func.cc
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 81870e6b7a3..268e294563d 100644 --- a/sql/debug_sync.cc +++ b/sql/debug_sync.cc @@ -1905,4 +1905,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) */ |