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 7922F6BD23; Wed, 14 Apr 2021 17:18:54 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7922F6BD23 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618409934; 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=ZUyfSW2ilkPgDNcvmTwjekUxfUDDlS2NulYBn7+rEkqSQYaN0xEFdXQy0YV0kBLpV XBXgfraQ8RZd3kJBfEmpJVxu84u7Ac0a+ljZTWTSAmZV+uZiAhx/omulISFy6bTL92 JPAV/19Si1y+QBfMvS/lAXlW7L0Cbq/UZYUHwL54= Received: from smtp41.i.mail.ru (smtp41.i.mail.ru [94.100.177.101]) (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 BBC726BD23 for ; Wed, 14 Apr 2021 17:17:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BBC726BD23 Received: by smtp41.i.mail.ru with esmtpa (envelope-from ) id 1lWgKa-000456-1b; Wed, 14 Apr 2021 17:17:24 +0300 To: v.shpilevoy@tarantool.org, gorcunov@gmail.com Date: Wed, 14 Apr 2021 17:17:13 +0300 Message-Id: <35263321df0b196b74bb8bf2fe7c74a64d260b3c.1618409665.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: 4F1203BC0FB41BD92FFCB8E6708E7480257C85EA0BB7A95D0F00AE41BB9A5343182A05F5380850408FBCDD139BEC5BDC60D073B6B9A4EC895A7FF471908F6414D1D6B9235C7BDD4A X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7BF6702EC5472AA0FEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637A8691684BB8CCFB18638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B26BB47E05DF60763349494189FF163752A2BB4B7391E66DBBD2E47CDBA5A96583C09775C1D3CA48CF53FA85A707D24CADCC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C0DEC8C2C8BCD2534D8941B15DA834481F9449624AB7ADAF37BA3038C0950A5D3613377AFFFEAFD26923F8577A6DFFEA7C241A2A579D1520917B076A6E789B0E97A8DF7F3B2552694A1E7802607F20496D49FD398EE364050FC65AC60A1F0286FE49AF716F719AB83EB3661434B16C20AC78D18283394535A9E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B643EA11082B2E15FD089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CB69F9342289A40B39FE28831B606568F7B4BD983BA63B8499C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF0417BEADF48D1460699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D341ADA1A41A420E9B273084F3052B6ECFD15DBB3A7BFEA1338B3363A0F47B24DB5F2EE0F96DA2977271D7E09C32AA3244C02D1F65D9DF82D7CAD539BEFA90B678F5A1673A01BA68E40927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojrcJA+pXcDum/buvsZFSzrQ== X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F832D6326595065D5C8B8C285E1EFF4D963B00933005611BEF424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v3 03/10] 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)