From 5c762bb84137fd8f571084e69fd3a2eb32273861 Mon Sep 17 00:00:00 2001 From: "wuzang.hdp" Date: Thu, 27 Jun 2019 10:54:56 +0800 Subject: [PATCH] misc fix --- .../modules/routing/readwritesplit/rwsplit_route_stmt.cc | 8 ++++---- server/modules/routing/readwritesplit/rwsplitsession.hh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc b/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc index 23f2f7e0d..2b2d0ec15 100644 --- a/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc +++ b/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc @@ -1002,7 +1002,7 @@ SRWBackend handle_hinted_target(RWSplitSession *rses, GWBUF *querybuf, /** * @brief Determine whether this stmt is subsequent COM_STMT_EXECUTE * - * @param cmd command type + * @param cmd command type * @param query GWBUF including the query * @param info Route info * @@ -1021,9 +1021,9 @@ bool is_sub_stmt_exec(uint8_t cmd, const GWBUF *query, uint16_t n_params) /*need n_params to parse new_params_bound_flag(alias send type to server)*/ int new_params_bound_flag_offset = MYSQL_HEADER_LEN + 10 + (n_params + 7) / 8; ss_dassert((int)gwbuf_length(query) >= new_params_bound_flag_offset); - uint8_t data[new_params_bound_flag_offset]; - gwbuf_copy_data(query, 0, new_params_bound_flag_offset, data); - if (data[new_params_bound_flag_offset]) + uint8_t flag; + gwbuf_copy_data(query, new_params_bound_flag_offset, 1, &flag); + if (flag) { rval = false; } diff --git a/server/modules/routing/readwritesplit/rwsplitsession.hh b/server/modules/routing/readwritesplit/rwsplitsession.hh index 4e5b49ff1..0ff32d5c0 100644 --- a/server/modules/routing/readwritesplit/rwsplitsession.hh +++ b/server/modules/routing/readwritesplit/rwsplitsession.hh @@ -203,7 +203,7 @@ static inline const char* rstostr(reply_state_t state) * * @param rses Router client session * @param buffer Buffer containing a binary protocol statement other than COM_STMT_PREPARE - * @param n_params statement parmas number + * @param n_params Statement parmas count * * @return The internal ID of the prepared statement that the buffer contents refer to */