Commit 4aacb20d authored by Sergei Golubchik's avatar Sergei Golubchik

fix XID comparison

according to the standard, the gtrid/bqual pair must be
"globally unique", so XIDs are equal if their gtrids and
bquals are identical, formatID simply tells how
gtrid/bqual were generated. But if formatID == -1
(it means "null") gtrid/bqual don't have any value at all.

This fixes main.xa_sync failure in
./mtr main.quary_cache_debug main.xa_sync
parent 89685d55
......@@ -563,9 +563,9 @@ struct xid_t {
xid_t() {} /* Remove gcc warning */
bool eq(struct xid_t *xid)
{ return eq(xid->gtrid_length, xid->bqual_length, xid->data); }
{ return !xid->is_null() && 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); }
{ return !is_null() && g == gtrid_length && b == bqual_length && !memcmp(d, data, g+b); }
void set(struct xid_t *xid)
{ memcpy(this, xid, xid->length()); }
void set(long f, const char *g, long gl, const char *b, long bl)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment