Fix handling of collected results

The result collection did not reset properly when a non-resultset was
returned for a request. As collected result need to be distinguishable
from single packet responses, a new buffer type was added.

The new buffer type is used by readwritesplit which uses result collection
for preparation of prepared statements.

Moved the current command tracking to the RWBackend class as the command
tracked by the protocol is can change before a response to the executed
command is received.

Removed a false debug assertion in the mxs_mysql_extract_ps_response
function that was triggered when a very large prepared statement response
was processed in multiple parts.
This commit is contained in:
Markus Mäkelä
2017-10-06 03:06:50 +03:00
committed by Johan Wikman
parent 948f66f918
commit a6eeed98fe
6 changed files with 50 additions and 35 deletions

View File

@ -57,7 +57,8 @@ typedef enum
GWBUF_TYPE_SESCMD = 0x04,
GWBUF_TYPE_HTTP = 0x08,
GWBUF_TYPE_IGNORABLE = 0x10,
GWBUF_TYPE_COLLECT_RESULT = 0x20
GWBUF_TYPE_COLLECT_RESULT = 0x20,
GWBUF_TYPE_RESULT = 0x40,
} gwbuf_type_t;
#define GWBUF_IS_TYPE_UNDEFINED(b) (b->gwbuf_type == 0)
@ -65,6 +66,7 @@ typedef enum
#define GWBUF_IS_TYPE_RESPONSE_END(b) (b->gwbuf_type & GWBUF_TYPE_RESPONSE_END)
#define GWBUF_IS_TYPE_SESCMD(b) (b->gwbuf_type & GWBUF_TYPE_SESCMD)
#define GWBUF_IS_IGNORABLE(b) (b->gwbuf_type & GWBUF_TYPE_IGNORABLE)
#define GWBUF_IS_COLLECTED_RESULT(b) (b->gwbuf_type & GWBUF_TYPE_RESULT)
#define GWBUF_SHOULD_COLLECT_RESULT(b) (b->gwbuf_type & GWBUF_TYPE_COLLECT_RESULT)
typedef enum