Commit aea0e125 authored by Marko Mäkelä's avatar Marko Mäkelä

trx_sys_read_wsrep_checkpoint(): Return whether a checkpoint is present

parent cd623508
...@@ -255,11 +255,11 @@ trx_sys_update_wsrep_checkpoint( ...@@ -255,11 +255,11 @@ trx_sys_update_wsrep_checkpoint(
trx_sysf_t* sys_header, /*!< in: sys_header */ trx_sysf_t* sys_header, /*!< in: sys_header */
mtr_t* mtr); /*!< in: mtr */ mtr_t* mtr); /*!< in: mtr */
void /** Read WSREP checkpoint XID from sys header.
/** Read WSREP checkpoint XID from sys header. */ @param[out] xid WSREP XID
trx_sys_read_wsrep_checkpoint( @return whether the checkpoint was present */
/*==========================*/ bool
XID* xid); /*!< out: WSREP XID */ trx_sys_read_wsrep_checkpoint(XID* xid);
#endif /* WITH_WSREP */ #endif /* WITH_WSREP */
/** Initializes the tablespace tag system. */ /** Initializes the tablespace tag system. */
......
...@@ -349,10 +349,11 @@ trx_sys_update_wsrep_checkpoint( ...@@ -349,10 +349,11 @@ trx_sys_update_wsrep_checkpoint(
} }
void /** Read WSREP checkpoint XID from sys header.
trx_sys_read_wsrep_checkpoint( @param[out] xid WSREP XID
/*==========================*/ @return whether the checkpoint was present */
XID* xid) bool
trx_sys_read_wsrep_checkpoint(XID* xid)
{ {
trx_sysf_t* sys_header; trx_sysf_t* sys_header;
mtr_t mtr; mtr_t mtr;
...@@ -372,7 +373,7 @@ trx_sys_read_wsrep_checkpoint( ...@@ -372,7 +373,7 @@ trx_sys_read_wsrep_checkpoint(
memcpy(xid->data + 24, &seqno, sizeof(long long)); memcpy(xid->data + 24, &seqno, sizeof(long long));
xid->formatID = -1; xid->formatID = -1;
mtr_commit(&mtr); mtr_commit(&mtr);
return; return false;
} }
xid->formatID = (int)mach_read_from_4( xid->formatID = (int)mach_read_from_4(
...@@ -389,6 +390,7 @@ trx_sys_read_wsrep_checkpoint( ...@@ -389,6 +390,7 @@ trx_sys_read_wsrep_checkpoint(
XIDDATASIZE); XIDDATASIZE);
mtr_commit(&mtr); mtr_commit(&mtr);
return true;
} }
#endif /* WITH_WSREP */ #endif /* WITH_WSREP */
......
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