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 31CA96EC5D; Fri, 9 Apr 2021 19:53:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 31CA96EC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617987203; bh=5WcxZX8e/hFuiF5mlpnZz/p7SfbPbnwye1tQs0t1KP0=; h=To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=HFlhT3LCTG+5gq4yZbve5yfkwFS8No3pmIAcGixXxvJ31tJsrqvl7z0QPDzAs26UV SU0C8ZYR/dWUdJj9v4b/p6MJ8xIRwM9xGtFcysmzmdFRtmGor3RS5IjwLzsxKrUQ9e 4NI/yxFNI6PwZYzN6/FyC7600RQNHSh2sVWCWfwM= Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 342D76EC61 for ; Fri, 9 Apr 2021 19:51:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 342D76EC61 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1lUuM2-0005n5-GM; Fri, 09 Apr 2021 19:51:34 +0300 To: v.shpilevoy@tarantool.org, tsafin@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Fri, 9 Apr 2021 19:51:34 +0300 Message-Id: <27e3259d43aef66129582e4461a064c38599a72e.1617984948.git.imeevma@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92FFCB8E6708E7480B1C8842CE613979772AC4B34408C6525182A05F538085040A28F0E4DA5E3B252E87E065F654406B4E7D36D915D1CDDD1D0D34B7061C97781 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7026187065A2CADDDEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006371E8C7BD479B346ED8638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2CDB2BB8154CD4B64C75E9800899DFE4406708AB62ED68B8ED2E47CDBA5A96583C09775C1D3CA48CF27ED053E960B195E117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE7850F8B975A76562C9FA2833FD35BB23DF004C906525384302BEBFE083D3B9BA73A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E735C6EABA9B74D0DA47B5C8C57E37DE458BEDA766A37F9254B7 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CD0035DD76F8A8A4F024A84D92DF23680E69DFEA6F9A6B9A89C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF0417BEADF48D1460699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D348CDF4129B2EA85603193FD2AB7EBF711A68574FA435356936942E30FFB6A6517F1157894AB2536E61D7E09C32AA3244CE0D4BC68919E3EEA2120A540348A4535853296C06374E602FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojyO2lHpuZu4Tba3EpolABdg== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822A557F48CB89DA271BC3BF87A22F8CF8283D72C36FC87018B9F80AB2734326CD2FB559BB5D741EB96352A0ABBE4FDA4210A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH v5 04/52] sql: remove NULL-termination in OP_ResultRow 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: Mergen Imeev via Tarantool-patches Reply-To: imeevma@tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" There is no need for NULL-termination, since MEMs converted to msgpack and msgpack do not require NULL-terminated strings. Needed for #5818 --- src/box/sql/vdbe.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c index 4c1cd582b..18806b93f 100644 --- a/src/box/sql/vdbe.c +++ b/src/box/sql/vdbe.c @@ -1505,9 +1505,6 @@ case OP_SCopy: { /* out2 */ * the result row. */ case OP_ResultRow: { - Mem *pMem; - int i; - assert(p->nResColumn==pOp->p2); assert(pOp->p1>0); assert(pOp->p1+pOp->p2<=(p->nMem+1 - p->nCursor)+1); @@ -1516,20 +1513,14 @@ case OP_ResultRow: { /* Invalidate all ephemeral cursor row caches */ p->cacheCtr = (p->cacheCtr + 2)|1; - /* Make sure the results of the current row are \000 terminated - * and have an assigned type. The results are de-ephemeralized as - * a side effect. - */ - pMem = p->pResultSet = &aMem[pOp->p1]; - for(i=0; ip2; i++) { + p->pResultSet = &aMem[pOp->p1]; +#ifdef SQL_DEBUG + struct Mem *pMem = p->pResultSet; + for(int i = 0; i < pOp->p2; i++) { assert(memIsValid(&pMem[i])); - Deephemeralize(&pMem[i]); - assert((pMem[i].flags & MEM_Ephem)==0 - || (pMem[i].flags & (MEM_Str|MEM_Blob))==0); - sqlVdbeMemNulTerminate(&pMem[i]); REGISTER_TRACE(p, pOp->p1+i, &pMem[i]); } - if (db->mallocFailed) goto no_mem; +#endif if (db->mTrace & SQL_TRACE_ROW) { db->xTrace(SQL_TRACE_ROW, db->pTraceArg, p, 0); -- 2.25.1