From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 555956F87A; Fri, 16 Apr 2021 19:27:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 555956F87A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618590471; bh=dTAhtkQZMkQM5ZV7NSuUkq8xvqVFjJADZypPn1YEfY8=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=uLdom8TXv4k3c5MJBjvzUejDhKgnpy/H2aKCzx7MN5QU+Yh8q/AiJQB1jMUKLZ35b yQSWCxPvIsmOwO6GMh4H/7VQjVYU0fODwAshC5fsMhbsethCUJGadXIbyZiStmSRXn wY32+jIdAuCpz++MA3IGtE60KalqmUOvK7a1STDc= Received: from smtp17.mail.ru (smtp17.mail.ru [94.100.176.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 3F0F56F87A for ; Fri, 16 Apr 2021 19:25:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3F0F56F87A Received: by smtp17.mail.ru with esmtpa (envelope-from ) id 1lXRHy-00008e-Aw; Fri, 16 Apr 2021 19:25:50 +0300 To: v.shpilevoy@tarantool.org, gorcunov@gmail.com Date: Fri, 16 Apr 2021 19:25:35 +0300 Message-Id: <21f01492ade0dbf463d3edf77aeb6d1e488630bd.1618590211.git.sergepetrenko@tarantool.org> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E7480257C85EA0BB7A95D0F00AE41BB9A5343182A05F538085040FF6101B09B82985EE90BB11A8DBBF8402FEE343EDB24E4F86B06420A6F1D3663 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE75263010198C72082EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006371AA4FDB8B3812E678638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2204C5310A72DA7DBA62CEE327EB6EA25AD368CDB2FD0D9CCD2E47CDBA5A96583C09775C1D3CA48CFA12191B5F2BB8629117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE77E7E81EEA8A9722B8941B15DA834481F9449624AB7ADAF37BA3038C0950A5D3613377AFFFEAFD26923F8577A6DFFEA7C9172FC12BFC6A30A7B076A6E789B0E97A8DF7F3B2552694A1E7802607F20496D49FD398EE364050F4B6963042765DA4B6E0066C2D8992A16C4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B9149C560DC76099D75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A24209795067102C07E8F7B195E1C978319E09578807932652D792DD908DDF4B51 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CBF1196BB3248DD4B4ADE3ECF618E0F4C1DF2BD672B666EBB9C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF0417BEADF48D1460699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34FF70CCB59A6ED870225DE9A93518374A98AE7C7D0C10BC18B1BCB0D31579B8133551AFEC425797B51D7E09C32AA3244CC7A8EA69BFC0F18FC8C0BC8C5578463EE8FBBEFAE1C4874C927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj3S6P1v0GIqQb6cToqVOsAg== X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F88BD3238A7C907672510B814F3A026FF6442F0E40A562C2E8424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v4 04/12] box: actualise iproto_key_type array X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Serge Petrenko via Tarantool-patches Reply-To: Serge Petrenko Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" iproto_key_type array is used while validating incoming requests, but it was only half-filled. The last initialized field was 0x2b, while IPROTO_KEY_MAX is currently 0x54. We got away with it, since the array is only used in xrow_header_decode(), xrow_decode_dml() and xrow_decode_synchro(), and all the keys usually present in these requests were present in the array. This is not true anymore, so it's time to make array contents up to date with all the IPROTO_KEY_* constants we have. Part of #5445 --- src/box/iproto_constants.c | 58 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/src/box/iproto_constants.c b/src/box/iproto_constants.c index 029d9888c..addda39dc 100644 --- a/src/box/iproto_constants.c +++ b/src/box/iproto_constants.c @@ -90,6 +90,64 @@ const unsigned char iproto_key_type[IPROTO_KEY_MAX] = /* 0x2a */ MP_MAP, /* IPROTO_TUPLE_META */ /* 0x2b */ MP_MAP, /* IPROTO_OPTIONS */ /* }}} */ + + /* {{{ unused */ + /* 0x2c */ MP_UINT, + /* 0x2d */ MP_UINT, + /* 0x2e */ MP_UINT, + /* 0x2f */ MP_UINT, + /* }}} */ + + /* {{{ body -- response keys */ + /* 0x30 */ MP_ARRAY, /* IPROTO_DATA */ + /* 0x31 */ MP_STR, /* IPROTO_ERROR_24 */ + /* 0x32 */ MP_ARRAY, /* IPROTO_METADATA */ + /* 0x33 */ MP_ARRAY, /* IPROTO_BIND_METADATA */ + /* 0x34 */ MP_UINT, /* IIPROTO_BIND_COUNT */ + /* }}} */ + + /* {{{ unused */ + /* 0x35 */ MP_UINT, + /* 0x36 */ MP_UINT, + /* 0x37 */ MP_UINT, + /* 0x38 */ MP_UINT, + /* 0x39 */ MP_UINT, + /* 0x3a */ MP_UINT, + /* 0x3b */ MP_UINT, + /* 0x3c */ MP_UINT, + /* 0x3d */ MP_UINT, + /* 0x3e */ MP_UINT, + /* 0x3f */ MP_UINT, + /* }}} */ + + /* {{{ body -- sql keys */ + /* 0x40 */ MP_STR, /* IPROTO_SQL_TEXT */ + /* 0x41 */ MP_ARRAY, /* IPROTO_SQL_BIND */ + /* 0x42 */ MP_MAP, /* IPROTO_SQL_INFO */ + /* 0x43 */ MP_UINT, /* IPROTO_STMT_ID */ + /* }}} */ + + /* {{{ unused */ + /* 0x44 */ MP_UINT, + /* 0x45 */ MP_UINT, + /* 0x46 */ MP_UINT, + /* 0x47 */ MP_UINT, + /* 0x48 */ MP_UINT, + /* 0x49 */ MP_UINT, + /* 0x4a */ MP_UINT, + /* 0x4b */ MP_UINT, + /* 0x4c */ MP_UINT, + /* 0x4d */ MP_UINT, + /* 0x4e */ MP_UINT, + /* 0x4f */ MP_UINT, + /* }}} */ + + /* {{{ body -- additional request keys */ + /* 0x50 */ MP_BOOL, /* IPROTO_REPLICA_ANON */ + /* 0x51 */ MP_ARRAY, /* IPROTO_ID_FILTER */ + /* 0x52 */ MP_MAP, /* IPROTO_ERROR */ + /* 0x53 */ MP_UINT, /* IPROTO_TERM */ + /* }}} */ }; const char *iproto_type_strs[] = -- 2.24.3 (Apple Git-128)