Replace gwbuf_clone_all with gwbuf_clone

gwbuf_clone cloned only the first buffer of a chain of buffers,
which never can be the desired outcome, while gwbuf_clone_all
cloned all buffers.

Now, gwbuf_clone behaves the way gwbuf_clone_all used to behave
and gwbuf_clone_all has been removed.
This commit is contained in:
Johan Wikman
2016-12-19 10:20:16 +02:00
parent 875766cf62
commit 6e6a3e4626
5 changed files with 31 additions and 21 deletions

View File

@ -916,7 +916,7 @@ GWBUF* clone_query(TEE_INSTANCE* my_instance, TEE_SESSION* my_session, GWBUF* bu
if ((!my_instance->match && !my_instance->nomatch) || packet_is_required(buffer))
{
clone = gwbuf_clone_all(buffer);
clone = gwbuf_clone(buffer);
}
else
{
@ -927,7 +927,7 @@ GWBUF* clone_query(TEE_INSTANCE* my_instance, TEE_SESSION* my_session, GWBUF* bu
if ((my_instance->match && regexec(&my_instance->re, ptr, 0, NULL, 0) == 0) ||
(my_instance->nomatch && regexec(&my_instance->nore, ptr, 0, NULL, 0) != 0))
{
clone = gwbuf_clone_all(buffer);
clone = gwbuf_clone(buffer);
}
MXS_FREE(ptr);
}

View File

@ -321,7 +321,7 @@ GWBUF *sescmd_cursor_clone_querybuf(sescmd_cursor_t *scur)
}
ss_dassert(scur->scmd_cur_cmd != NULL);
buf = gwbuf_clone_all(scur->scmd_cur_cmd->my_sescmd_buf);
buf = gwbuf_clone(scur->scmd_cur_cmd->my_sescmd_buf);
CHK_GWBUF(buf);
return buf;