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 D25FE6B469; Tue, 23 Mar 2021 12:53:17 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D25FE6B469 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616493197; bh=ixdS7DWK+JawmBzFoZ68LtrrFwekueYdcr68D1mmdG0=; 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=OI7zaCB9qsvNciKH6JfTw+lHkeUltdFr+NDuuk5jYCAEJy+GGFd2dphKQ5isxx3p3 IW+v6aEq6TUhzxpZ4YlUaKBANMo+I+owWf/fezF2+tR1wZcO0ErAy1QO10IuRi1XyX LKh0U/bKf6gbm2+TdeS//LNKsw4iUzwhZMS8/Q3g= Received: from smtp36.i.mail.ru (smtp36.i.mail.ru [94.100.177.96]) (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 320E868F5C for ; Tue, 23 Mar 2021 12:36:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 320E868F5C Received: by smtp36.i.mail.ru with esmtpa (envelope-from ) id 1lOdSQ-0001ro-F7; Tue, 23 Mar 2021 12:36:14 +0300 To: v.shpilevoy@tarantool.org, tsafin@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Tue, 23 Mar 2021 12:36:13 +0300 Message-Id: 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: 4F1203BC0FB41BD95D6E7CC48CB1F5F1DDD90A25A8FA528D0BFD61B598B81272182A05F5380850408D03B3CA8D5C746E1A749CB9806D65DAB53A75CFB3E0047902A5AF0288E2C1BB X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE77BF46084C0059042EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006378ABD31E9FF1CD53C8638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C686AF563A045C75EC2BF695E4BBEFBEDB6CF9776B95F4556A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE74796267E12EBBF229FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C3EEA082C9A12FE455117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CF856009BA58C5E1BBBA3038C0950A5D36C8A9BA7A39EFB766EC990983EF5C0329BA3038C0950A5D36D5E8D9A59859A8B6731810A3EF82FA8F76E601842F6C81A1F004C906525384307823802FF610243DF43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B3BBE47FD9DD3FB59A8DF7F3B2552694A57739F23D657EF2B13377AFFFEAFD26923F8577A6DFFEA7C2C2559B29ED8195093EC92FD9297F6715571747095F342E857739F23D657EF2BD5E8D9A59859A8B6D75B66E98413B381089D37D7C0E48F6C5571747095F342E857739F23D657EF2B6825BDBE14D8E7024847893F9AA87235E5BFE6E7EFDEDCD789D4C264860C145E X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A24A6D60772A99906F8E1CD14B953EB46D3CB265E0CC2A5787355D89D7DBCDD132 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C686AF563A045C75EC2BF695E4BBEFBEDB6CF9776B95F45569C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF0417BEADF48D1460699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D341776B9FDE05FBA7A6FA6F50DFDE75CF9F9E15DEC279EE9C78BE7A12862821B508D15A2D6E9F721C21D7E09C32AA3244C0341DC64744B1AB082472D3C99B65A10F94338140B71B8EEFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojWJZv20R+6UjaVelWPloqvg== X-Mailru-Sender: 5C3750E245F362008BC1685FEC6306EDD8D1833EF5AE85D61A749CB9806D65DA49EBE2174CCC94795105BD0848736F9966FEC6BF5C9C28D97E07721503EA2E00ED97202A5A4E92BF7402F9BA4338D657ED14614B50AE0675 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v4 37/53] sql: introduce mem_set_frame() 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" This patch introduces mem_set_frame() function. Function mem_set_frame() sets a frame to MEM. This frame used for internal VDBE operations. Part of #5818 --- src/box/sql/mem.c | 9 +++++++++ src/box/sql/mem.h | 3 +++ src/box/sql/vdbe.c | 3 +-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/box/sql/mem.c b/src/box/sql/mem.c index 3701741ef..078de0e62 100644 --- a/src/box/sql/mem.c +++ b/src/box/sql/mem.c @@ -604,6 +604,15 @@ mem_set_pointer(struct Mem *mem, void *ptr) mem->field_type = field_type_MAX; } +void +mem_set_frame(struct Mem *mem, struct VdbeFrame *frame) +{ + mem_clear(mem); + mem->flags = MEM_Frame; + mem->u.pFrame = frame; + mem->field_type = field_type_MAX; +} + int mem_copy(struct Mem *to, const struct Mem *from) { diff --git a/src/box/sql/mem.h b/src/box/sql/mem.h index 9fec6ed8a..a6c53c615 100644 --- a/src/box/sql/mem.h +++ b/src/box/sql/mem.h @@ -268,6 +268,9 @@ mem_set_undefined(struct Mem *mem); void mem_set_pointer(struct Mem *mem, void *ptr); +void +mem_set_frame(struct Mem *mem, struct VdbeFrame *frame); + int mem_copy(struct Mem *to, const struct Mem *from); diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c index b9c2142e8..b01b8d760 100644 --- a/src/box/sql/vdbe.c +++ b/src/box/sql/vdbe.c @@ -4073,8 +4073,7 @@ case OP_Program: { /* jump */ goto no_mem; } mem_destroy(pRt); - pRt->flags = MEM_Frame; - pRt->u.pFrame = pFrame; + mem_set_frame(pRt, pFrame); pFrame->v = p; pFrame->nChildMem = nMem; -- 2.25.1