Commit dde234ae authored by unknown's avatar unknown

WL 2826: Nineth step

Updated error inject scripts


dbug/dbug_long.h:
  Updated scripts in dub_long.h as well
sql/mysql_priv.h:
  Updated error inject scripts
parent 846adac5
...@@ -127,6 +127,11 @@ ...@@ -127,6 +127,11 @@
# define DBUG_SETJMP setjmp # define DBUG_SETJMP setjmp
# define DBUG_LONGJMP longjmp # define DBUG_LONGJMP longjmp
# define DBUG_DUMP(keyword,a1) # define DBUG_DUMP(keyword,a1)
# define DBUG_EXECUTE_IF(keyword, a1)
# define DBUG_EXECUTE_COND(keyword, a1) 0
# define DBUG_COND(keyword) 0
# define DBUG_ADD_KEYWORD(key)
# define DBUG_DEL_KEYWORD(key)
# else # else
# define DBUG_ENTER(a) \ # define DBUG_ENTER(a) \
auto char *_db_func_; auto char *_db_file_; auto int _db_level_; \ auto char *_db_func_; auto char *_db_file_; auto int _db_level_; \
...@@ -157,4 +162,12 @@ ...@@ -157,4 +162,12 @@
# define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1)) # define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))
# define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2)) # define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))
# define DBUG_DUMP(keyword,a1,a2) _db_dump_(__LINE__,keyword,a1,a2) # define DBUG_DUMP(keyword,a1,a2) _db_dump_(__LINE__,keyword,a1,a2)
# define DBUG_EXECUTE_IF(keyword,a1) \
{if (_db_on_) {if (_db_strict_keyword_ (keyword)) { a1 }}}
# define DBUG_EXECUTE_COND(keyword, a1) \
(_db_on_ ? ((_db_strict_keyword_ (keyword)) ? ((a1), 0) : 0) : 0)
# define DBUG_COND(keyword) \
((_db_on_ && _db_strict_keyword_ (keyword)) ? 1 : 0)
# define DBUG_ADD_KEYWORD(key) _db_add_strict_keyword_(key)
# define DBUG_DEL_KEYWORD(key) _db_del_strict_keyword_(key)
# endif # endif
...@@ -622,6 +622,18 @@ struct Query_cache_query_flags ...@@ -622,6 +622,18 @@ struct Query_cache_query_flags
#define SET_ERROR_INJECT_VALUE(x) \ #define SET_ERROR_INJECT_VALUE(x) \
current_thd->error_inject_value= (x) current_thd->error_inject_value= (x)
inline bool
my_error_inject_name(const char *dbug_str)
{
if (_db_on_ && _db_strict_keyword_ (dbug_str))
{
DBUG_DEL_KEYWORD(dbug_str);
return 1;
}
return 0;
}
inline bool inline bool
my_error_inject(int value) my_error_inject(int value)
{ {
...@@ -637,9 +649,9 @@ my_error_inject(int value) ...@@ -637,9 +649,9 @@ my_error_inject(int value)
#define ERROR_INJECT_CRASH(code) \ #define ERROR_INJECT_CRASH(code) \
DBUG_EXECUTE_COND(code, abort();) DBUG_EXECUTE_COND(code, abort();)
#define ERROR_INJECT_ACTION(code, action) \ #define ERROR_INJECT_ACTION(code, action) \
DBUG_EXECUTE_COND(code, action) (my_error_inject_name(code) ? ((action), 0) : 0)
#define ERROR_INJECT(code) \ #define ERROR_INJECT(code) \
DBUG_COND(code) my_error_inject_name(code)
#define ERROR_INJECT_VALUE(value) \ #define ERROR_INJECT_VALUE(value) \
my_error_inject(value) my_error_inject(value)
#define ERROR_INJECT_VALUE_ACTION(value,action) \ #define ERROR_INJECT_VALUE_ACTION(value,action) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment