MXS-852: Store the internal ID in the buffer

If the internal ID is stored in the buffer when it is moving inside the
readwritesplit router, the RWBackend can manage the execution of all
commands with a statement ID by replacing the stored ID with the correct
value.
This commit is contained in:
Markus Mäkelä
2017-06-21 18:22:16 +03:00
parent 3c4e1e3b4b
commit 5fc30740b7
9 changed files with 93 additions and 45 deletions

View File

@ -352,6 +352,28 @@ GWBUF* gwbuf_clone(GWBUF* buf)
return rval;
}
GWBUF* gwbuf_deep_clone(const GWBUF* buf)
{
GWBUF* rval = NULL;
if (buf)
{
size_t buflen = gwbuf_length(buf);
rval = gwbuf_alloc(buflen);
if (rval && gwbuf_copy_data(buf, 0, buflen, GWBUF_DATA(rval)) == buflen)
{
rval->gwbuf_type = buf->gwbuf_type;
}
else
{
gwbuf_free(rval);
rval = NULL;
}
}
return rval;
}
static GWBUF *gwbuf_clone_portion(GWBUF *buf,
size_t start_offset,