~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/xid.h

  • Committer: Brian Aker
  • Date: 2010-02-04 15:58:21 UTC
  • mfrom: (1280.1.9 build)
  • Revision ID: brian@gaz-20100204155821-bi4txluiivy043sb
Rollup of Brian, Jay

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef DRIZZLED_XID_H
21
21
#define DRIZZLED_XID_H
22
22
 
 
23
#include <cstring>
 
24
 
23
25
extern uint32_t server_id;
24
26
 
25
27
/**
49
51
  long bqual_length;
50
52
  char data[XIDDATASIZE];  // not \0-terminated !
51
53
 
52
 
  XID();
 
54
  XID() :
 
55
    formatID(-1), /* -1 == null */
 
56
    gtrid_length(0),
 
57
    bqual_length(0)
 
58
  {
 
59
    memset(data, 0, XIDDATASIZE);
 
60
  }
53
61
  bool eq(XID *xid);
54
62
  bool eq(long g, long b, const char *d);
55
63
  void set(XID *xid);
87
95
#define MIN_XID_LIST_SIZE  128
88
96
#define MAX_XID_LIST_SIZE  (1024*128)
89
97
 
90
 
typedef struct st_xid_state {
 
98
class XID_STATE 
 
99
{
 
100
public:
 
101
  XID_STATE() :
 
102
    xid(),
 
103
    xa_state(XA_NOTR),
 
104
    in_session(false)
 
105
  {}
91
106
  /* For now, this is only used to catch duplicated external xids */
92
107
  XID  xid;                           // transaction identifier
93
108
  enum xa_states xa_state;            // used by external XA only
94
109
  bool in_session;
95
 
} XID_STATE;
 
110
};
96
111
 
97
112
bool xid_cache_init(void);
98
113
void xid_cache_free(void);