520.4.31
by Monty Taylor
Removed server_id from common_includes. |
1 |
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
|
2 |
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
|
|
3 |
*
|
|
1999.6.1
by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file |
4 |
* Copyright (C) 2008 Sun Microsystems, Inc.
|
520.4.31
by Monty Taylor
Removed server_id from common_includes. |
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or modify
|
|
7 |
* it under the terms of the GNU General Public License as published by
|
|
8 |
* the Free Software Foundation; version 2 of the License.
|
|
9 |
*
|
|
10 |
* This program is distributed in the hope that it will be useful,
|
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13 |
* GNU General Public License for more details.
|
|
14 |
*
|
|
15 |
* You should have received a copy of the GNU General Public License
|
|
16 |
* along with this program; if not, write to the Free Software
|
|
17 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
18 |
*/
|
|
19 |
||
2234
by Brian Aker
Mass removal of ifdef/endif in favor of pragma once. |
20 |
#pragma once
|
520.4.31
by Monty Taylor
Removed server_id from common_includes. |
21 |
|
1273.1.4
by Jay Pipes
This patch significantly reworks the way that |
22 |
#include <cstring> |
23 |
||
2221.6.1
by Olaf van der Spek
Refactor |
24 |
namespace drizzled { |
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
25 |
|
520.4.31
by Monty Taylor
Removed server_id from common_includes. |
26 |
extern uint32_t server_id; |
27 |
||
28 |
/**
|
|
29 |
class XID _may_ be binary compatible with the XID structure as
|
|
30 |
in the X/Open CAE Specification, Distributed Transaction Processing:
|
|
31 |
The XA Specification, X/Open Company Ltd., 1991.
|
|
32 |
http://www.opengroup.org/bookstore/catalog/c193.htm
|
|
33 |
||
34 |
*/
|
|
35 |
||
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
36 |
typedef uint64_t my_xid; |
520.4.31
by Monty Taylor
Removed server_id from common_includes. |
37 |
|
38 |
#define DRIZZLE_XIDDATASIZE 128
|
|
2154.2.23
by Brian Aker
Remove dependency from session of error handler |
39 |
#define DRIZZLE_XID_PREFIX "DrizzleXid"
|
520.4.31
by Monty Taylor
Removed server_id from common_includes. |
40 |
#define DRIZZLE_XID_PREFIX_LEN 8 // must be a multiple of 8 |
41 |
#define DRIZZLE_XID_OFFSET (DRIZZLE_XID_PREFIX_LEN+sizeof(server_id))
|
|
42 |
#define DRIZZLE_XID_GTRID_LEN (DRIZZLE_XID_OFFSET+sizeof(my_xid))
|
|
43 |
||
2224.1.1
by Olaf van der Spek
Finish removing XID cache |
44 |
class XID |
2221.6.1
by Olaf van der Spek
Refactor |
45 |
{
|
520.4.31
by Monty Taylor
Removed server_id from common_includes. |
46 |
public: |
47 |
long formatID; |
|
48 |
long gtrid_length; |
|
49 |
long bqual_length; |
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
50 |
char data[DRIZZLE_XIDDATASIZE]; // not \0-terminated ! |
520.4.31
by Monty Taylor
Removed server_id from common_includes. |
51 |
|
1273.1.4
by Jay Pipes
This patch significantly reworks the way that |
52 |
XID() : |
53 |
formatID(-1), /* -1 == null */ |
|
54 |
gtrid_length(0), |
|
55 |
bqual_length(0) |
|
56 |
{
|
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
57 |
memset(data, 0, DRIZZLE_XIDDATASIZE); |
1273.1.4
by Jay Pipes
This patch significantly reworks the way that |
58 |
}
|
520.4.31
by Monty Taylor
Removed server_id from common_includes. |
59 |
bool eq(XID *xid); |
60 |
bool eq(long g, long b, const char *d); |
|
61 |
void set(XID *xid); |
|
62 |
void set(long f, const char *g, long gl, const char *b, long bl); |
|
63 |
void set(uint64_t xid); |
|
64 |
void set(long g, long b, const char *d); |
|
65 |
bool is_null(); |
|
66 |
void null(); |
|
67 |
my_xid quick_get_my_xid(); |
|
68 |
my_xid get_my_xid(); |
|
2221.6.1
by Olaf van der Spek
Refactor |
69 |
uint32_t length() const; |
70 |
const unsigned char* key() const; |
|
71 |
uint32_t key_length() const; |
|
520.4.31
by Monty Taylor
Removed server_id from common_includes. |
72 |
};
|
73 |
||
74 |
/**
|
|
2154.2.23
by Brian Aker
Remove dependency from session of error handler |
75 |
struct st_DrizzleXid is binary compatible with the XID structure as
|
520.4.31
by Monty Taylor
Removed server_id from common_includes. |
76 |
in the X/Open CAE Specification, Distributed Transaction Processing:
|
77 |
The XA Specification, X/Open Company Ltd., 1991.
|
|
78 |
http://www.opengroup.org/bookstore/catalog/c193.htm
|
|
79 |
||
80 |
*/
|
|
1836.2.1
by tdavies
File: /drizzled/xid.h. Changed struct name of 'st_drizzle_xid' to 'drizzle_xid', changed it to a C++ class and added constructor initialization list |
81 |
|
2224.1.1
by Olaf van der Spek
Finish removing XID cache |
82 |
class DrizzleXid |
2221.6.1
by Olaf van der Spek
Refactor |
83 |
{
|
1836.2.1
by tdavies
File: /drizzled/xid.h. Changed struct name of 'st_drizzle_xid' to 'drizzle_xid', changed it to a C++ class and added constructor initialization list |
84 |
public: |
520.4.31
by Monty Taylor
Removed server_id from common_includes. |
85 |
long formatID; |
86 |
long gtrid_length; |
|
87 |
long bqual_length; |
|
88 |
char data[DRIZZLE_XIDDATASIZE]; /* Not \0-terminated */ |
|
1836.2.1
by tdavies
File: /drizzled/xid.h. Changed struct name of 'st_drizzle_xid' to 'drizzle_xid', changed it to a C++ class and added constructor initialization list |
89 |
|
2154.2.23
by Brian Aker
Remove dependency from session of error handler |
90 |
DrizzleXid() : |
1836.2.1
by tdavies
File: /drizzled/xid.h. Changed struct name of 'st_drizzle_xid' to 'drizzle_xid', changed it to a C++ class and added constructor initialization list |
91 |
formatID(0), |
92 |
gtrid_length(0), |
|
93 |
bqual_length(0) |
|
94 |
{
|
|
1836.2.2
by tdavies
File: /drizzled/xid.h. Changed struct name of 'st_drizzle_xid' to 'drizzle_xid', changed it to a C++ class and added constructor initialization list |
95 |
memset(data, 0, DRIZZLE_XIDDATASIZE); |
1836.2.1
by tdavies
File: /drizzled/xid.h. Changed struct name of 'st_drizzle_xid' to 'drizzle_xid', changed it to a C++ class and added constructor initialization list |
96 |
}
|
520.4.31
by Monty Taylor
Removed server_id from common_includes. |
97 |
};
|
98 |
||
934.2.15
by Jay Pipes
Pulls remainder of XID and xid_cache implementation into xid.cc and xid.h from drizzled/session.cc. |
99 |
enum xa_states {XA_NOTR=0, XA_ACTIVE, XA_IDLE, XA_PREPARED}; |
100 |
extern const char *xa_state_names[]; |
|
520.4.31
by Monty Taylor
Removed server_id from common_includes. |
101 |
|
1130.1.4
by Monty Taylor
Moved StorageEngine into plugin namespace. |
102 |
/* for recover() plugin::StorageEngine call */
|
520.4.31
by Monty Taylor
Removed server_id from common_includes. |
103 |
#define MIN_XID_LIST_SIZE 128
|
104 |
#define MAX_XID_LIST_SIZE (1024*128)
|
|
105 |
||
2224.1.1
by Olaf van der Spek
Finish removing XID cache |
106 |
class XID_STATE |
1273.1.4
by Jay Pipes
This patch significantly reworks the way that |
107 |
{
|
108 |
public: |
|
109 |
XID_STATE() : |
|
110 |
xa_state(XA_NOTR), |
|
111 |
in_session(false) |
|
112 |
{}
|
|
934.2.15
by Jay Pipes
Pulls remainder of XID and xid_cache implementation into xid.cc and xid.h from drizzled/session.cc. |
113 |
/* For now, this is only used to catch duplicated external xids */
|
114 |
XID xid; // transaction identifier |
|
2221.6.1
by Olaf van der Spek
Refactor |
115 |
xa_states xa_state; // used by external XA only |
934.2.15
by Jay Pipes
Pulls remainder of XID and xid_cache implementation into xid.cc and xid.h from drizzled/session.cc. |
116 |
bool in_session; |
1273.1.4
by Jay Pipes
This patch significantly reworks the way that |
117 |
};
|
934.2.15
by Jay Pipes
Pulls remainder of XID and xid_cache implementation into xid.cc and xid.h from drizzled/session.cc. |
118 |
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
119 |
} /* namespace drizzled */ |
120 |