776
return the list of XID's to a client, the same way SHOW commands do.
779
I didn't find in XA specs that an RM cannot return the same XID twice,
780
so mysql_xa_recover does not filter XID's to ensure uniqueness.
781
It can be easily fixed later, if necessary.
783
bool TransactionServices::mysql_xa_recover(Session *session)
785
List<Item> field_list;
789
field_list.push_back(new Item_int("formatID", 0, MY_INT32_NUM_DECIMAL_DIGITS));
790
field_list.push_back(new Item_int("gtrid_length", 0, MY_INT32_NUM_DECIMAL_DIGITS));
791
field_list.push_back(new Item_int("bqual_length", 0, MY_INT32_NUM_DECIMAL_DIGITS));
792
field_list.push_back(new Item_empty_string("data", DRIZZLE_XIDDATASIZE));
794
if (session->client->sendFields(&field_list))
797
pthread_mutex_lock(&LOCK_xid_cache);
798
while ((xs= (XID_STATE*)hash_element(&xid_cache, i++)))
800
if (xs->xa_state==XA_PREPARED)
802
session->client->store((int64_t)xs->xid.formatID);
803
session->client->store((int64_t)xs->xid.gtrid_length);
804
session->client->store((int64_t)xs->xid.bqual_length);
805
session->client->store(xs->xid.data,
806
xs->xid.gtrid_length+xs->xid.bqual_length);
807
if (session->client->flush())
809
pthread_mutex_unlock(&LOCK_xid_cache);
815
pthread_mutex_unlock(&LOCK_xid_cache);
820
775
struct ResourceContextCompare : public std::binary_function<ResourceContext *, ResourceContext *, bool>
822
777
result_type operator()(const ResourceContext *lhs, const ResourceContext *rhs) const