1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Bug#13143 - formatID should not affect XID's uniqueness

This commit is contained in:
unknown
2005-10-05 16:38:53 +02:00
parent ef16a04160
commit 07172cabdf
4 changed files with 19 additions and 7 deletions

View File

@ -228,7 +228,7 @@ struct xid_t {
char data[XIDDATASIZE]; // not \0-terminated !
bool eq(struct xid_t *xid)
{ return !memcmp(this, xid, length()); }
{ return eq(xid->gtrid_length, xid->bqual_length, xid->data); }
bool eq(long g, long b, const char *d)
{ return g == gtrid_length && b == bqual_length && !memcmp(d, data, g+b); }
void set(struct xid_t *xid)
@ -276,6 +276,14 @@ struct xid_t {
return sizeof(formatID)+sizeof(gtrid_length)+sizeof(bqual_length)+
gtrid_length+bqual_length;
}
byte *key()
{
return (byte *)&gtrid_length;
}
uint key_length()
{
return sizeof(gtrid_length)+sizeof(bqual_length)+gtrid_length+bqual_length;
}
};
typedef struct xid_t XID;