mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-31 18:24:25 +03:00
Implemented client last_written_gtid, sync_wait
This commit is contained in:
15
src/gtid.cpp
15
src/gtid.cpp
@ -4,7 +4,9 @@
|
||||
|
||||
#include "wsrep/gtid.hpp"
|
||||
|
||||
#include <cerrno>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
std::ostream& wsrep::operator<<(std::ostream& os, const wsrep::gtid& gtid)
|
||||
{
|
||||
@ -21,3 +23,16 @@ std::istream& wsrep::operator>>(std::istream& is, wsrep::gtid& gtid)
|
||||
std::cout << "GTID: " << gtid << "\n";
|
||||
return is;
|
||||
}
|
||||
|
||||
ssize_t wsrep::gtid_print_to_c_str(
|
||||
const wsrep::gtid& gtid, char* buf, size_t buf_len)
|
||||
{
|
||||
std::ostringstream os;
|
||||
os << gtid;
|
||||
if (os.str().size() > buf_len)
|
||||
{
|
||||
return -ENOBUFS;
|
||||
}
|
||||
std::strncpy(buf, os.str().c_str(), os.str().size());
|
||||
return os.str().size();
|
||||
}
|
||||
|
Reference in New Issue
Block a user