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 78C9B6EC5B; Mon, 1 Mar 2021 16:46:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 78C9B6EC5B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1614606366; bh=y74qyG1AlSpEIPhE6FNZHMMv5Fj2Iu+KFS2YAVk3K4A=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=w2xsgdrmAR+Inl/8yRv8RLEnhft3sowmBA/m92xBHYy6bNntMG4pRjN4R9GJq6Wu8 SoMQMTbwrSibrHNZFSp1VatFJ6aKaTdhSwDbZFk9mE59I0+kCybd+82htEDE+KnOc7 pyf3m2qGW6asif3R1gA4jDQCdGGzDB6JKQvS6Vaw= Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 4AF9C6EC5B for ; Mon, 1 Mar 2021 16:46:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4AF9C6EC5B Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1lGis7-0000hb-LS; Mon, 01 Mar 2021 16:46:04 +0300 To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org References: <68a02630-efac-0e6c-d6ab-0af18d0192c1@tarantool.org> <33adda25-ba4d-b50c-575e-9dd30b38488a@tarantool.org> Message-ID: <49412fc2-da26-dc44-0d40-2f73cbe46cf3@tarantool.org> Date: Mon, 1 Mar 2021 16:46:03 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9795828B892398B72BB71EC733CE1D6E17BA9E8B9BEDD7952182A05F538085040B79DBC012A6E7A0C48D068665C064946C2498F9C222720651E730D67DF00B1CE X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7A8325FA649D0A450EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006375AC38C7EC4509C8B8638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC17C6117F61ECB881E23225B81F65B9E4B0F20119174D5A42389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C078FCF50C7EAF9C588941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6A0EE70D6C4970CA7A471835C12D1D977C4224003CC836476EC64975D915A344093EC92FD9297F6718AA50765F79006373BA04B6A498D0BA467F23339F89546C5A8DF7F3B2552694A6FED454B719173D6725E5C173C3A84C3BBEB9517EB7DA65B35872C767BF85DA2F004C906525384306FED454B719173D6462275124DF8B9C9DE2850DD75B2526BE5BFE6E7EFDEDCD789D4C264860C145E X-C1DE0DAB: 0D63561A33F958A57085FB8FE07EE9471B773C2FE81C191472616D75BD6807CDD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75448CF9D3A7B2C848410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34D2AC226BFD455724D4A218DC61429138BFCA8ADD59D7A943DB87F9774F26B62630D1A620ED14F2761D7E09C32AA3244CF734E8990862C4731B74CA5F7BCEDC4DFE8DA44ABE2443F7729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojnpKwxR6GFbtTz0DeH8uLPA== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822D3A8AA5AD271BF3591C30FD09645E453DD788429FD8613638ED9BB8B05EE7B3AFB559BB5D741EB96D19CD4E7312BAA970A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v8 04/14] test: fix luacheck warnings W211 in test/sql-tap 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: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hello! On 28.02.2021 18:30, Vladislav Shpilevoy wrote: > Thanks for the fixes! > >> --- a/test/sql-tap/select9.test.lua >> +++ b/test/sql-tap/select9.test.lua >> @@ -274,10 +274,8 @@ test:do_execsql_test( >>          -- >>      }) >> >> -local t1_space_id = "" >> -local t2_space_id = "" >> -t1_space_id = test:execsql([[SELECT * from "_space" where "name"='T1']])["id"] >> -t2_space_id = test:execsql([[SELECT * from "_space" where "name"='T2']])["id"] >> +local _ = test:execsql([[SELECT * from "_space" where "name"='T1']])["id"] >> +local _ = test:execsql([[SELECT * from "_space" where "name"='T2']])["id"] > But nothing changed. It was the same before my comment. By 'delete' them I > mean literally 'delete'. SELECTs don't have any effect unlike DML/DDL. You > can remove them and nothing will change. > > ==================== It was a misunderstanding. Removed it now. --- a/test/sql-tap/select9.test.lua +++ b/test/sql-tap/select9.test.lua @@ -274,8 +274,6 @@ test:do_execsql_test(          --      }) -local _ = test:execsql([[SELECT * from "_space" where "name"='T1']])["id"] -local _ = test:execsql([[SELECT * from "_space" where "name"='T2']])["id"]  --X(276, "X!cmd", [=[["db","eval","SELECT * from _space where name='t2'","data","\n  set t2_space_id $data(id)\n"]]=])  --local function reverse(lhs, rhs)  --    return X(283, "X!cmd", [=[["string","compare",["rhs"],["lhs"]]]=]) > }) > > -local _ = test:execsql([[SELECT * from "_space" where "name"='T1']])["id"] > -local _ = test:execsql([[SELECT * from "_space" where "name"='T2']])["id"] > --X(276, "X!cmd", [=[["db","eval","SELECT * from _space where name='t2'","data","\n set t2_space_id $data(id)\n"]]=]) > ==================== > > However even if we would would to keep them you wouldn't need `local _ = `. > You can call functions without saving their result into a variable. luacheck reports an error when result of function is not assigned to variable. With patch: --- a/test/sql-tap/select9.test.lua +++ b/test/sql-tap/select9.test.lua @@ -274,8 +274,7 @@ test:do_execsql_test(          --      }) -local _ = test:execsql([[SELECT * from "_space" where "name"='T1']])["id"] -local _ = test:execsql([[SELECT * from "_space" where "name"='T2']])["id"] +test:execsql([[SELECT * from "_space" where "name"='T1']])["id"]  --X(276, "X!cmd", [=[["db","eval","SELECT * from _space where name='t2'","data","\n  set t2_space_id $data(id)\n"]]=])  --local function reverse(lhs, rhs)  --    return X(283, "X!cmd", [=[["string","compare",["rhs"],["lhs"]]]=]) it reports: Checking test/sql-tap/select9.test.lua            1 error     test/sql-tap/select9.test.lua:289:1: (E011) expected '=' near 'iOuterLoop' Total: 0 warnings / 1 error in 264 files iOuterLoop is a variable on a next uncommented line. Seems Lua requires that function's result must be assigned to variable.