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 E08B26BD0C; Sun, 11 Apr 2021 21:10:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E08B26BD0C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1618164622; bh=AyeZ2z6RLs36rBHcYXwtoHdXljfzjb2qYEzm44AkHdo=; h=To:Cc:References:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=jctEgOPRjTZqVrxB9xaqrCOw6NauJIN3Tn2RU7r51UYvMjAGQNY5OYX1CfT+YJHgE zzjVZB5Yvqx8bPPIjNtV098dTNnXj0EJxVYNAXjaKFi3I5UqYaEGixLYBUG6Rj0Evl Em1mXE8iO7brONSTKWnczpSLWz/RbyBAqblHhO6s= Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 C72606BD0C for ; Sun, 11 Apr 2021 21:10:21 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C72606BD0C Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1lVeXM-00027l-Sk; Sun, 11 Apr 2021 21:10:21 +0300 To: imeevma@tarantool.org, tsafin@tarantool.org Cc: tarantool-patches@dev.tarantool.org References: <91cec4dbcc1d931b70cdba3c70d77e7c58a00675.1617984948.git.imeevma@gmail.com> Message-ID: <0dc519d0-2c2c-4d88-0efa-f1dff782b9cc@tarantool.org> Date: Sun, 11 Apr 2021 20:10:19 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <91cec4dbcc1d931b70cdba3c70d77e7c58a00675.1617984948.git.imeevma@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E7480D608FE24BC85426BB1B55F651FED8C70182A05F538085040A3A8CAF862173A233A0BBBF267CCD7977E9DA1C310075218609FC6C4D9FE1DAA X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7D73594321916E098C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE75644E22E05AA81AE52120BFB3F63BC18BE95F64BC9A3199D1BDDB23E98D2D38BD6CF32B5F8F9D404E394BC8250CCD38516E68E391C0AF7B9CC7F00164DA146DAFE8445B8C89999728AA50765F790063783E00425F71A4181389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8062BEEFFB5F8EA3EF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B65919A4F84E78481C089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C97831B8DD766AD79AE7AFD5EE6400B98F466E X-C1DE0DAB: 0D63561A33F958A5A37DA269D02D5117A6F097AF65D9FEF82B19F9D9C50897C1D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34C6EC1BD9807109D26F99370526D5088DB9B535D936D73994E88725A6ADDA0698AB4D4F3B464C2C501D7E09C32AA3244CEEEA2CFA5CAB23CDE13E0E77D2D26078259227199D06760AFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojyKKJYJ15DtJQVRAJWurMjQ== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822A6BEEF343EF228B9EE18CD11A0FF15873841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v5 14/52] sql: introduce mem_copy_as_ephemeral() 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Thanks for working on this! >>> @@ -593,9 +598,12 @@ sqlVdbeMemAboutToChange(Vdbe * pVdbe, Mem * pMem) >>> int i; >>> Mem *pX; >>> for (i = 0, pX = pVdbe->aMem; i < pVdbe->nMem; i++, pX++) { >>> - if (pX->pScopyFrom == pMem) { >>> - pX->flags |= MEM_Undefined; >>> - pX->pScopyFrom = 0; >>> + if ((pX->flags & (MEM_Blob | MEM_Str)) != 0 && >>> + (pX->flags & (MEM_Ephem | MEM_Static)) == 0) { >>> + if (pX->pScopyFrom == pMem) { >>> + pX->flags |= MEM_Undefined; >>> + pX->pScopyFrom = 0; >>> + } >> >> 2. Why did you change that? >> > This check is only useful for strings and binaries, since they may be lost due > to change of another MEM. Also, due to this function it was possible that value > of type other than MEM_Blob or MEM_Str will have MEM_Ephem set. This is wrong, I > believe. Due to which function? sqlVdbeMemAboutToChange() does not set MEM_Ephem.