~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/error_injection.h

  • Committer: Monty Taylor
  • Date: 2008-10-20 08:48:34 UTC
  • mfrom: (520.1.22 drizzle)
  • Revision ID: monty@inaugust.com-20081020084834-xpb3w01vkcp55o02
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
inline bool
58
58
check_and_unset_inject_value(int value)
59
59
{
60
 
  THD *thd= current_thd;
61
 
  if (thd->error_inject_value == (uint)value)
 
60
  Session *session= current_session;
 
61
  if (session->error_inject_value == (uint)value)
62
62
  {
63
 
    thd->error_inject_value= 0;
 
63
    session->error_inject_value= 0;
64
64
    return 1;
65
65
  }
66
66
  return 0;
94
94
  code is removed.
95
95
 
96
96
  Sometimes it is necessary to perform error inject actions as a serie
97
 
  of events. In this case one can use one variable on the THD object.
 
97
  of events. In this case one can use one variable on the Session object.
98
98
  Thus one sets this value by using e.g. SET_ERROR_INJECT_VALUE(100).
99
99
  Then one can later test for it by using ERROR_INJECT_CRASH_VALUE,
100
100
  ERROR_INJECT_ACTION_VALUE and ERROR_INJECT_VALUE. This have the same
102
102
  error inject value instead of a code used by debug macros.
103
103
*/
104
104
#define SET_ERROR_INJECT_VALUE(x) \
105
 
  current_thd->error_inject_value= (x)
 
105
  current_session->error_inject_value= (x)
106
106
#define ERROR_INJECT_ACTION(code, action) \
107
107
  (check_and_unset_keyword(code) ? ((action), 0) : 0)
108
108
#define ERROR_INJECT(code) \