MXS-1935: Accent NULL from qc_get_preparable_stmt in readwritesplit
If the prepared statement cannot be extracted from the query, treat it as a query with an unknown type.
This commit is contained in:
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
uint32_t get_prepare_type(GWBUF* buffer)
|
uint32_t get_prepare_type(GWBUF* buffer)
|
||||||
{
|
{
|
||||||
uint32_t type;
|
uint32_t type = QUERY_TYPE_UNKNOWN;
|
||||||
|
|
||||||
if (mxs_mysql_get_command(buffer) == MXS_COM_STMT_PREPARE)
|
if (mxs_mysql_get_command(buffer) == MXS_COM_STMT_PREPARE)
|
||||||
{
|
{
|
||||||
@ -48,9 +48,11 @@ uint32_t get_prepare_type(GWBUF* buffer)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
GWBUF* stmt = qc_get_preparable_stmt(buffer);
|
GWBUF* stmt = qc_get_preparable_stmt(buffer);
|
||||||
ss_dassert(stmt);
|
|
||||||
|
|
||||||
type = qc_get_type_mask(stmt);
|
if (stmt)
|
||||||
|
{
|
||||||
|
type = qc_get_type_mask(stmt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ss_dassert((type & (QUERY_TYPE_PREPARE_STMT | QUERY_TYPE_PREPARE_NAMED_STMT)) == 0);
|
ss_dassert((type & (QUERY_TYPE_PREPARE_STMT | QUERY_TYPE_PREPARE_NAMED_STMT)) == 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user