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 120B96EC40; Tue, 17 Aug 2021 13:43:46 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 120B96EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1629197026; bh=s/ISeZ1CFNVkDcLGBhUVKMoH0ulbbnvQU9QAOfKoiMs=; 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=TixZHWdTUaiu+yny6lyikzzfvcXUY9wSsg0sH63fH6tVsyOmgDYiMHI8GSc92V2M2 4Mis62v6Q5O9NokmAuUcrxrBQNfnf0jDeuLkdhD3gA924qOsNsMoEP9Jxpj4niCest LvWSryjSGY4DFrrzYejGarVuREm+GxmdbZpKT1Qs= Received: from smtpng2.i.mail.ru (smtpng2.i.mail.ru [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 CAEBE6EC43 for ; Tue, 17 Aug 2021 13:43:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CAEBE6EC43 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1mFwYq-0008KO-Ud; Tue, 17 Aug 2021 13:43:13 +0300 To: vdavydov@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Tue, 17 Aug 2021 13:43:12 +0300 Message-Id: <58ae14ebee1aa6d28b11a395d37f270b29d40f72.1629196232.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-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD9D5AC6413C25DCF08CC98B8FCC5CD86F3182A05F538085040521B4FE89E9E0F22F0FAF96480FEE6A7880F82FDD7D7EFDD312CD8E89ACB76CD X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7235646FAB97B4BEDEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063748E7A03516F25E8E8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D87DBD119CE335A7D970AC275CD83A7FC8117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAA867293B0326636D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8BAA867293B0326636D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6B1CFA6D474D4A6A4089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458834459D11680B505CDA6C9EBFF1E0F2F794EE30CF6F1B773 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C5B73F950BC6E7FFB4F3EA99463C6B7B73419FFD9C25C22D89C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EFD827CA74CCEABFF3699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3494FB0335DF05DC3A5631DD839B17D66C9338D0EDC3FCC7AB2F127C976EBFF1CA7AAA0DBCC6AF65A81D7E09C32AA3244CF03AEB38DDE6F57BB0C93E7D6472CB4BD9ADFF0C0BDB8D1F729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojIrFL/N5KnVH5YcKUUxVW8A== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D7D6E90944D363D2DAA2EE01DFCFDD78C83D72C36FC87018B9F80AB2734326CD2FB559BB5D741EB96352A0ABBE4FDA4210A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 1/2] sql: rename some sql_ephemeral_space_* functions 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 renames sql_ephemeral_space_new() to sql_template_space_new() and sql_ephemeral_space_def_new() to sql_template_space_def_new(). The objects created by these functions are not really ephemeral space or space_def and have a single purpose - to create a "template" space that will be used later when creating real space. Needed for #6213 --- src/box/sql.c | 11 +++++------ src/box/sql.h | 4 ++-- src/box/sql/build.c | 4 ++-- src/box/sql/select.c | 8 ++++---- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/box/sql.c b/src/box/sql.c index c805a1e5c..0e93aa7bb 100644 --- a/src/box/sql.c +++ b/src/box/sql.c @@ -1161,14 +1161,14 @@ space_column_default_expr(uint32_t space_id, uint32_t fieldno) } /** - * Create and initialize a new ephemeral space_def object. + * Create and initialize a new template space_def object. * @param parser SQL Parser object. * @param name Name of space to be created. * @retval NULL on memory allocation error, Parser state changed. * @retval not NULL on success. */ static struct space_def * -sql_ephemeral_space_def_new(struct Parse *parser, const char *name) +sql_template_space_def_new(struct Parse *parser, const char *name) { struct space_def *def = NULL; size_t name_len = name != NULL ? strlen(name) : 0; @@ -1178,8 +1178,7 @@ sql_ephemeral_space_def_new(struct Parse *parser, const char *name) def = (struct space_def *)region_aligned_alloc(&parser->region, size, alignof(*def)); if (def == NULL) { - diag_set(OutOfMemory, size, "region_aligned_alloc", - "sql_ephemeral_space_def_new"); + diag_set(OutOfMemory, size, "region_aligned_alloc", "def"); parser->is_aborted = true; return NULL; } @@ -1192,7 +1191,7 @@ sql_ephemeral_space_def_new(struct Parse *parser, const char *name) } struct space * -sql_ephemeral_space_new(Parse *parser, const char *name) +sql_template_space_new(Parse *parser, const char *name) { size_t sz; struct space *space = region_alloc_object(&parser->region, @@ -1204,7 +1203,7 @@ sql_ephemeral_space_new(Parse *parser, const char *name) } memset(space, 0, sz); - space->def = sql_ephemeral_space_def_new(parser, name); + space->def = sql_template_space_def_new(parser, name); if (space->def == NULL) return NULL; diff --git a/src/box/sql.h b/src/box/sql.h index 2ac97c762..3ff00e64a 100644 --- a/src/box/sql.h +++ b/src/box/sql.h @@ -221,14 +221,14 @@ void sql_expr_delete(struct sql *db, struct Expr *expr, bool extern_alloc); /** - * Create and initialize a new ephemeral space object. + * Create and initialize a new template space object. * @param parser SQL Parser object. * @param name Name of space to be created. * @retval NULL on memory allocation error, Parser state changed. * @retval not NULL on success. */ struct space * -sql_ephemeral_space_new(struct Parse *parser, const char *name); +sql_template_space_new(struct Parse *parser, const char *name); /** * Duplicate Expr list. diff --git a/src/box/sql/build.c b/src/box/sql/build.c index 6470e0300..478037f29 100644 --- a/src/box/sql/build.c +++ b/src/box/sql/build.c @@ -225,7 +225,7 @@ sqlStartTable(Parse *pParse, Token *pName) if (sqlCheckIdentifierName(pParse, zName) != 0) goto cleanup; - new_space = sql_ephemeral_space_new(pParse, zName); + new_space = sql_template_space_new(pParse, zName); if (new_space == NULL) goto cleanup; @@ -300,7 +300,7 @@ static struct space * sql_shallow_space_copy(struct Parse *parse, struct space *space) { assert(space->def != NULL); - struct space *ret = sql_ephemeral_space_new(parse, space->def->name); + struct space *ret = sql_template_space_new(parse, space->def->name); if (ret == NULL) goto error; ret->index_count = space->index_count; diff --git a/src/box/sql/select.c b/src/box/sql/select.c index b9107fccc..7cfe60db6 100644 --- a/src/box/sql/select.c +++ b/src/box/sql/select.c @@ -2061,7 +2061,7 @@ sqlResultSetOfSelect(Parse * pParse, Select * pSelect) while (pSelect->pPrior) pSelect = pSelect->pPrior; pParse->sql_flags = saved_flags; - struct space *space = sql_ephemeral_space_new(pParse, NULL); + struct space *space = sql_template_space_new(pParse, NULL); if (space == NULL) return NULL; /* The sqlResultSetOfSelect() is only used in contexts where lookaside @@ -4688,7 +4688,7 @@ withExpand(Walker * pWalker, struct SrcList_item *pFrom) } assert(pFrom->space == NULL); - pFrom->space = sql_ephemeral_space_new(pParse, pCte->zName); + pFrom->space = sql_template_space_new(pParse, pCte->zName); if (pFrom->space == NULL) return WRC_Abort; pFrom->pSelect = sqlSelectDup(db, pCte->pSelect, 0); @@ -4888,8 +4888,8 @@ selectExpander(Walker * pWalker, Select * p) */ const char *name = "sql_sq_DEADBEAFDEADBEAF"; struct space *space = - sql_ephemeral_space_new(sqlParseToplevel(pParse), - name); + sql_template_space_new(sqlParseToplevel(pParse), + name); if (space == NULL) return WRC_Abort; pFrom->space = space; -- 2.25.1