[Commits] a8998486189: XPand: fix compile error on Winx64: pass ushort to add_command_operand_ushort
revision-id: a8998486189e4257a321e66c38c711990e11aa60 (mariadb-10.4.4-755-ga8998486189) parent(s): 62f04a2e803a620b80905b189a9c4f2f250e4df6 author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2020-03-10 01:28:13 +0300 message: XPand: fix compile error on Winx64: pass ushort to add_command_operand_ushort Also add a safety check --- storage/xpand/xpand_connection.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/storage/xpand/xpand_connection.cc b/storage/xpand/xpand_connection.cc index 8d2ccf00816..cf2d07820f4 100644 --- a/storage/xpand/xpand_connection.cc +++ b/storage/xpand/xpand_connection.cc @@ -948,7 +948,11 @@ int xpand_connection::scan_next(xpand_connection_cursor *scan, if ((error_code = begin_command(XPAND_SCAN_NEXT))) return error_code; - if ((error_code = add_command_operand_ushort(scan->buffer_size))) + // This should not happen as @@xpand_row_buffer has this limit. + if (scan->buffer_size > 65535) + return HA_ERR_INTERNAL_ERROR; + + if ((error_code = add_command_operand_ushort((ushort)scan->buffer_size))) return error_code; if ((error_code = add_command_operand_lcb(scan->scan_refid)))
participants (1)
-
psergey