[Commits] 4042bb891cb: XPand: fix compile error on Winx64: pass ushort to add_command_operand_ushort
revision-id: 4042bb891cbb759b519802bfdc6b3867b2eff5c2 (mariadb-10.5.0-244-g4042bb891cb) parent(s): 3b7b3843eb437544735a10bf4a03929430e69dea author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2020-03-04 14:26:12 +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 d8425e603e4..28e545fff6d 100644 --- a/storage/xpand/xpand_connection.cc +++ b/storage/xpand/xpand_connection.cc @@ -899,7 +899,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