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 BF92E6EC5B; Mon, 12 Apr 2021 22:41:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BF92E6EC5B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618256516; 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=PLdBI8Si4ddMLC50riVJvv6QtGaRRfn70vFaANy1sAeB8ACd/6vzGQPTRaFafKt5j 4BOBevDp2tMhbKiRd7PQ94exavaeRb7Sj4XiuoH65Xz6eM2GHMhe6PLuRxlWYqtVqh EldfO70S2mdmjDF/+KcDlGgTS4aSoZBv/nGkwMF0= Received: from smtp53.i.mail.ru (smtp53.i.mail.ru [94.100.177.113]) (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 8E9ED6F86F for ; Mon, 12 Apr 2021 22:40:26 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8E9ED6F86F Received: by smtp53.i.mail.ru with esmtpa (envelope-from ) id 1lW2Q5-0008Az-Pj; Mon, 12 Apr 2021 22:40:26 +0300 To: v.shpilevoy@tarantool.org, gorcunov@gmail.com Date: Mon, 12 Apr 2021 22:40:16 +0300 Message-Id: <583a6c735f095146c3ef882158330e985c3c5d9e.1618256019.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: 4F1203BC0FB41BD92FFCB8E6708E7480D608FE24BC85426BB1B55F651FED8C70182A05F538085040BB8C9BFD44C567C06FFEBB35CA34344DF7F24D9516276CA72D03B0F8DF793BCF X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE75AD53DF1D86BACA3EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006370E0E628E5A2670BA8638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B254589181C3A8AC120B01CCCA3101667EC7C2BEF539CC105AD2E47CDBA5A96583C09775C1D3CA48CFA12191B5F2BB8629117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE7ABB305BD10C6E5099FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE740FEA8D7F28272697B076A6E789B0E97A8DF7F3B2552694A1E7802607F20496D49FD398EE364050F437C869540D2AB0FB78CF848AE20165DB3661434B16C20AC78D18283394535A9E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B66F1C5D350F9AE87C089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2368A440D3B0F6089093C9A16E5BC824A2A04A2ABAA09D25379311020FFC8D4ADF048BB164F7B76AF354880391DE99277 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CB69F9342289A40B33043BF4D6B8CDF6605FF3A00D77F88869C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF0417BEADF48D1460699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34FACF503ACC83041B1670E22EB8FDD150B629AB31F799F0BE846D99416A96427E6FF6C5920AE430CA1D7E09C32AA3244C54E357C80392356FF3C8CDC16C7093AD1E098CBE561D6343927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojq8JA+pXcDunTWB0jdQhgiA== X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F8AFCB052CDF231E7BF21267F2103BD5804A0D108C0F332373424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 3/9] 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)