340
342
#define HA_CREATE_USED_PAGE_CHECKSUM (1L << 21)
341
343
#define HA_CREATE_USED_BLOCK_SIZE (1L << 22)
343
typedef uint64_t my_xid; // this line is the same as in log_event.h
344
#define DRIZZLE_XID_PREFIX "MySQLXid"
345
#define DRIZZLE_XID_PREFIX_LEN 8 // must be a multiple of 8
346
#define DRIZZLE_XID_OFFSET (DRIZZLE_XID_PREFIX_LEN+sizeof(server_id))
347
#define DRIZZLE_XID_GTRID_LEN (DRIZZLE_XID_OFFSET+sizeof(my_xid))
349
#define XIDDATASIZE DRIZZLE_XIDDATASIZE
350
345
#define MAXGTRIDSIZE 64
351
346
#define MAXBQUALSIZE 64
357
352
uint32_t key_length,
358
353
uint64_t *engine_data);
361
struct xid_t is binary compatible with the XID structure as
362
in the X/Open CAE Specification, Distributed Transaction Processing:
363
The XA Specification, X/Open Company Ltd., 1991.
364
http://www.opengroup.org/bookstore/catalog/c193.htm
366
@see DRIZZLE_XID in mysql/plugin.h
372
char data[XIDDATASIZE]; // not \0-terminated !
374
xid_t() {} /* Remove gcc warning */
375
bool eq(struct xid_t *xid)
376
{ return eq(xid->gtrid_length, xid->bqual_length, xid->data); }
377
bool eq(long g, long b, const char *d)
378
{ return g == gtrid_length && b == bqual_length && !memcmp(d, data, g+b); }
379
void set(struct xid_t *xid)
380
{ memcpy(this, xid, xid->length()); }
381
void set(long f, const char *g, long gl, const char *b, long bl)
384
memcpy(data, g, gtrid_length= gl);
385
memcpy(data+gl, b, bqual_length= bl);
387
void set(uint64_t xid)
391
set(DRIZZLE_XID_PREFIX_LEN, 0, DRIZZLE_XID_PREFIX);
392
memcpy(data+DRIZZLE_XID_PREFIX_LEN, &server_id, sizeof(server_id));
394
memcpy(data+DRIZZLE_XID_OFFSET, &tmp, sizeof(tmp));
395
gtrid_length=DRIZZLE_XID_GTRID_LEN;
397
void set(long g, long b, const char *d)
402
memcpy(data, d, g+b);
404
bool is_null() { return formatID == -1; }
405
void null() { formatID= -1; }
406
my_xid quick_get_my_xid()
409
memcpy(&tmp, data+DRIZZLE_XID_OFFSET, sizeof(tmp));
414
return gtrid_length == DRIZZLE_XID_GTRID_LEN && bqual_length == 0 &&
415
!memcmp(data+DRIZZLE_XID_PREFIX_LEN, &server_id, sizeof(server_id)) &&
416
!memcmp(data, DRIZZLE_XID_PREFIX, DRIZZLE_XID_PREFIX_LEN) ?
417
quick_get_my_xid() : 0;
421
return sizeof(formatID)+sizeof(gtrid_length)+sizeof(bqual_length)+
422
gtrid_length+bqual_length;
426
return (unsigned char *)>rid_length;
428
uint32_t key_length()
430
return sizeof(gtrid_length)+sizeof(bqual_length)+gtrid_length+bqual_length;
433
typedef struct xid_t XID;
435
/* for recover() handlerton call */
436
#define MIN_XID_LIST_SIZE 128
437
#define MAX_XID_LIST_SIZE (1024*128)
439
356
struct handlerton;