~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/error_injection.h

  • Committer: Stewart Smith
  • Date: 2009-06-16 03:02:59 UTC
  • mto: This revision was merged to the branch mainline in revision 1065.
  • Revision ID: stewart@flamingspork.com-20090616030259-tn2thqrajk6cappd
ER_NISAMCHK is unused, mark it as so. Thanks to Paul DuBois for researching this for MySQL.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 */
19
19
 
20
20
#ifndef ERROR_INJECT_SUPPORT
21
 
/**  
22
 
 * @file 
 
21
/**
 
22
 * @file
23
23
 *
24
 
 * Simple compile-time error injection module to enable easy 
 
24
 * Simple compile-time error injection module to enable easy
25
25
 * error printing in case of a crash
26
26
 */
27
27
#ifndef DRIZZLE_SERVER_ERROR_INJECTION_H
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 == (uint32_t)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) \