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 7215A6BD14; Sun, 11 Apr 2021 20:57:40 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7215A6BD14 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618163860; 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=gxmSYteidu90gmsz6hLsnDid0cBY9ywQFIhj49JlX/fkR02Tfc8FxHPDrwbtQ9rmg vH5AiQOUANkvef+U8s49PXYrSH1q8z4qxz/M+UJvvvlamF3tyWUUQevfh+GxMPPc2G O1EWs/cxmRtoBIlfewJlb02U3bYxDIB00yT1RiIA= Received: from smtp42.i.mail.ru (smtp42.i.mail.ru [94.100.177.102]) (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 9D08E6BD14 for ; Sun, 11 Apr 2021 20:56:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9D08E6BD14 Received: by smtp42.i.mail.ru with esmtpa (envelope-from ) id 1lVeJe-0001Ua-VA; Sun, 11 Apr 2021 20:56:11 +0300 To: v.shpilevoy@tarantool.org, gorcunov@gmail.com Date: Sun, 11 Apr 2021 20:55:58 +0300 Message-Id: <90e4309c81dc2007a1f6529871b2ec8420e5be6e.1618163409.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: 4F1203BC0FB41BD92FFCB8E6708E7480D608FE24BC85426BB1B55F651FED8C70182A05F538085040724A0C012C4C342DFD4EE69F2CC9B3B5FC1F907E81FAED8576BA5A02BB80AEAD X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE76042E2DB3E33BF2BEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637A361B53D384D9D40EA1F7E6F0F101C67CDEEF6D7F21E0D1D9295C2E9FA3191EE1B59CA4C82EFA658DD25A91B19D8BCB1F86E1F1142AB201DF6B57BC7E64490618DEB871D839B73339E8FC8737B5C2249F459A8243F1D1D44CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C04CF195F1528592878941B15DA834481F9449624AB7ADAF37BA3038C0950A5D3613377AFFFEAFD2691661749BA6B9773566A5F66989CCBBE47B076A6E789B0E97A8DF7F3B2552694A1E7802607F20496D49FD398EE364050FB28585415E75ADA986A01F665E7D37C5B3661434B16C20AC78D18283394535A9E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B67BEEC15D15C45022089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A24209795067102C07E8F7B195E1C9783191471F51605917AD60D789705920FE00 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CE44850EFB5864EA255700976EF6D7397C9032740B9B095D79C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF0417BEADF48D1460699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3454E98140CCACB5B35AFC448D9F0C94D083B592ABDBA7F07D08B05535C660BBEDFADCA748E3C36B9B1D7E09C32AA3244C991CE5504F8CD79C3664398E61BF397CA90944CA99CF22E3927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbL9S8ysBdXjz3uqod8pbhd6bh6EfDDCB X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F8A3D5B6EFD694386959D03527D68647DF5A363681E63C3A15424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH 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)