summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_plugin_services.ic2
-rw-r--r--sql/wsrep_xid.cc18
2 files changed, 16 insertions, 4 deletions
diff --git a/sql/sql_plugin_services.ic b/sql/sql_plugin_services.ic
index ea6aefa5993..47decf38973 100644
--- a/sql/sql_plugin_services.ic
+++ b/sql/sql_plugin_services.ic
@@ -154,6 +154,8 @@ static struct wsrep_service_st wsrep_handler = {
wsrep_aborting_thd_enqueue,
wsrep_consistency_check,
wsrep_is_wsrep_xid,
+ wsrep_xid_seqno,
+ wsrep_xid_uuid,
wsrep_lock_rollback,
wsrep_on,
wsrep_post_commit,
diff --git a/sql/wsrep_xid.cc b/sql/wsrep_xid.cc
index 5af39bfc230..6e3c1cf6386 100644
--- a/sql/wsrep_xid.cc
+++ b/sql/wsrep_xid.cc
@@ -39,7 +39,7 @@ void wsrep_xid_init(XID* xid, const wsrep_uuid_t& uuid, wsrep_seqno_t seqno)
memset(xid->data, 0, sizeof(xid->data));
memcpy(xid->data, WSREP_XID_PREFIX, WSREP_XID_PREFIX_LEN);
memcpy(xid->data + WSREP_XID_UUID_OFFSET, &uuid, sizeof(wsrep_uuid_t));
- memcpy(xid->data + WSREP_XID_SEQNO_OFFSET, &seqno, sizeof(wsrep_seqno_t));
+ int8store(xid->data + WSREP_XID_SEQNO_OFFSET,seqno);
}
int wsrep_is_wsrep_xid(const XID* xid)
@@ -59,13 +59,17 @@ const wsrep_uuid_t* wsrep_xid_uuid(const XID& xid)
return &WSREP_UUID_UNDEFINED;
}
+const unsigned char* wsrep_xid_uuid(const xid_t* xid)
+{
+ DBUG_ASSERT(xid);
+ return wsrep_xid_uuid(*xid)->data;
+}
+
wsrep_seqno_t wsrep_xid_seqno(const XID& xid)
{
if (wsrep_is_wsrep_xid(&xid))
{
- wsrep_seqno_t seqno;
- memcpy(&seqno, xid.data + WSREP_XID_SEQNO_OFFSET, sizeof(wsrep_seqno_t));
- return seqno;
+ return sint8korr(xid.data + WSREP_XID_SEQNO_OFFSET);
}
else
{
@@ -73,6 +77,12 @@ wsrep_seqno_t wsrep_xid_seqno(const XID& xid)
}
}
+wsrep_seqno_t wsrep_xid_seqno(const xid_t* xid)
+{
+ DBUG_ASSERT(xid);
+ return wsrep_xid_seqno(*xid);
+}
+
static my_bool set_SE_checkpoint(THD* unused, plugin_ref plugin, void* arg)
{
XID* xid= static_cast<XID*>(arg);