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 8D1C168F65; Tue, 23 Mar 2021 12:36:44 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8D1C168F65 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616492204; 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=yzlYmu/fIoHw7fGkVYLs8z5VVYPXrRplG6VSNUDwH7xd2lLN+ex7NXwlht4tQacTY MOaA+NVkmLRPzWGuX/ggF/B/RoqTVO4uAk/3vDgvqAaNpDynswPFPBg2hDzlgOFbdk uJEGY1WFWEVhYmxQAdh0weoSGOk0ID9qsbP8HxO0= Received: from smtp38.i.mail.ru (smtp38.i.mail.ru [94.100.177.98]) (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 0A67C6BD36 for ; Tue, 23 Mar 2021 12:34:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0A67C6BD36 Received: by smtp38.i.mail.ru with esmtpa (envelope-from ) id 1lOdRB-0006A6-DE; Tue, 23 Mar 2021 12:34:57 +0300 To: v.shpilevoy@tarantool.org, tsafin@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Tue, 23 Mar 2021 12:34:57 +0300 Message-Id: <19668950f0c5a01b83bba98051633c434e87e5fe.1616491731.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: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD95D6E7CC48CB1F5F146FB1591D6F88157BC7E60153CA0047A182A05F538085040B81883507CC2B1F593CF66CC8DFEFF6B2906B7D6D3B4485F6CE8131F756F4277 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7A25B432396ED6D32EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063727599E9BE65898D58638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C686AF563A045C75EF7332B11F8E8FFE94D585F3F60E28D3DA471835C12D1D9774AD6D5ED66289B5278DA827A17800CE70F3DDF2BBF19B93A9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C3E97D2AE7161E217F117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CFD43B390A86EC1E6DBA3038C0950A5D36C8A9BA7A39EFB766EC990983EF5C0329BA3038C0950A5D36D5E8D9A59859A8B6E8E471CADDBA01B476E601842F6C81A1F004C906525384307823802FF610243DF43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B3BBE47FD9DD3FB59A8DF7F3B2552694A57739F23D657EF2B13377AFFFEAFD26923F8577A6DFFEA7CE1AEB6AF2DA18B6293EC92FD9297F6715571747095F342E857739F23D657EF2BD5E8D9A59859A8B698B1B85E56A716AC089D37D7C0E48F6C5571747095F342E857739F23D657EF2B6825BDBE14D8E7024847893F9AA87235E5BFE6E7EFDEDCD789D4C264860C145E X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C686AF563A045C75EF7332B11F8E8FFE94D585F3F60E28D3D9C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF0417BEADF48D1460699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3433E9BC74ABA5769F6F7FF2DC1DA6DAD7F0C9D0E8EE462145F007800F118DE05CC2D507BF6CAF42D21D7E09C32AA3244C30B88950BD3C035B02B15DEE91A265B0F522A1CF68F4BE05FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojWJZv20R+6UhUHQ/4Zx3NUg== X-Mailru-Sender: 5C3750E245F362008BC1685FEC6306EDBC5A9F537708D6F893CF66CC8DFEFF6B52685D71546B8E9E5105BD0848736F9966FEC6BF5C9C28D97E07721503EA2E00ED97202A5A4E92BF7402F9BA4338D657ED14614B50AE0675 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v4 04/53] 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