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 5AC6971828; Tue, 23 Mar 2021 12:38:16 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5AC6971828 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616492296; bh=ElVoPfJEnuwLyPMsGq8mJAeNSms+6Nx/++yL9Ey55pY=; 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=flmRZCLxDAgUtXh3G5fsjQtEdG3KCR0bVZ9G38TySPZELgSFYYMeZeMJpNPDSJo4P SctG+zbld1rP4HXvH8D9UWxqNcswqXcGezPgh0kdAEigtwZZJ+DhanIRkDvwtkYVMZ T46Ym2KdRX04d/NVTcfP8MuqReAVck4SSQO+k1k8= Received: from smtp55.i.mail.ru (smtp55.i.mail.ru [217.69.128.35]) (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 1C63271828 for ; Tue, 23 Mar 2021 12:35:10 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1C63271828 Received: by smtp55.i.mail.ru with esmtpa (envelope-from ) id 1lOdRN-0001CG-Bd; Tue, 23 Mar 2021 12:35:09 +0300 To: v.shpilevoy@tarantool.org, tsafin@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Tue, 23 Mar 2021 12:35:08 +0300 Message-Id: <9830a56f8bd4ff73f69238e350b48e3941f88e29.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: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD95D6E7CC48CB1F5F1C82687294EF6886B62CC997B0B8C95C4182A05F5380850409602AAFF54C0999F7A921B96C13F9DDD2ED1544A51F4ED3BE3FBDC753963FF36 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7F544D30F1A6FA191EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006373C9FC9F3BACECB908638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C686AF563A045C75E0E06F656AA0AC0AB0FE7D16C70003294A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE7328B01A8D746D8839FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C353FA85A707D24CADCC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C22494D81D385C7AB3EB576E601842F6C81A12EF20D2F80756B5F7E9C4E3C761E06A776E601842F6C81A127C277FBC8AE2E8B5613D04DEA810176D81D268191BDAD3D698AB9A7B718F8C4D1B931868CE1C5781A620F70A64A45A98AA50765F79006372E808ACE2090B5E14AD6D5ED66289B52BA9C0B312567BB23089D37D7C0E48F6CA18204E546F3947CC0F9454058DFE53C5E1C53F199C2BB95C8A9BA7A39EFB7666BA297DBC24807EA089D37D7C0E48F6C8AA50765F7900637E497A0EAD2F87B28EFF80C71ABB335746BA297DBC24807EA27F269C8F02392CDC58410348177836EABEDDA51113D120200306258E7E6ABB4E4A6367B16DE6309 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2BBE337FB72E92315FF39D8DB89857825EFA8BF88FCBFD63CE0852D54D1EC5181386D740E071D760D88D7F57742A16B90 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C686AF563A045C75E0E06F656AA0AC0AB0FE7D16C700032949C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF0417BEADF48D1460699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34BD150993ED26DDF46E26C78F38F7FB1E81E43A29FB93DE9344AAD49417BC141E33F11C36E3C62CFF1D7E09C32AA3244C31A543F0085675EB303659DD71E54E1ED9ADFF0C0BDB8D1FFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojWJZv20R+6UgQFQh4iGhi6w== X-Mailru-Sender: 5C3750E245F362008BC1685FEC6306EDC62CDA06BC776ED17A921B96C13F9DDDC9F871340C5A6C405105BD0848736F9966FEC6BF5C9C28D97E07721503EA2E00ED97202A5A4E92BF7402F9BA4338D657ED14614B50AE0675 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v4 07/53] sql: disable unused code in sql/vdbemem.c 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 disables unused code in sql/vdbemem.c. It will simplify refactoring. Part of #5818 --- src/box/sql/sqlInt.h | 69 ++++++++++++++++++++++++++++--------------- src/box/sql/vdbemem.c | 20 +++++++++++++ 2 files changed, 66 insertions(+), 23 deletions(-) diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h index dd8163f5e..b4293d961 100644 --- a/src/box/sql/sqlInt.h +++ b/src/box/sql/sqlInt.h @@ -4151,31 +4151,54 @@ sql_expr_new_column(struct sql *db, struct SrcList *src_list, int src_idx, int sqlExprCheckIN(Parse *, Expr *); -int sqlStat4ProbeSetValue(Parse *, struct index_def *, UnpackedRecord **, Expr *, int, - int, int *); -int sqlStat4ValueFromExpr(Parse *, Expr *, enum field_type type, - sql_value **); -void sqlStat4ProbeFree(UnpackedRecord *); +/* TODO: Enable this function when stat-tables will be revived. */ +static inline int +sqlStat4ProbeSetValue(struct Parse *parse, struct index_def *def, + struct UnpackedRecord **rec, struct Expr *expr, int n, + int i, int *out) +{ + (void)parse; + (void)def; + (void)rec; + (void)expr; + (void)n; + (void)i; + (void)out; + unreachable(); + return 0; +} -/** - * Extract the col_num-th column from the record. Write - * the column value into *res. If *res is initially NULL - * then a new sql_value object is allocated. - * - * If *res is initially NULL then the caller is responsible for - * ensuring that the value written into *res is eventually - * freed. - * - * @param db Database handle. - * @param record Pointer to buffer containing record. - * @param col_num Column to extract. - * @param[out] res Extracted value. - * - * @retval -1 on error or 0. - */ -int +/* TODO: Enable this function when stat-tables will be revived. */ +static inline int +sqlStat4ValueFromExpr(struct Parse *parse, struct Expr *expr, + enum field_type type, struct Mem **mem) +{ + (void)parse; + (void)expr; + (void)type; + (void)mem; + unreachable(); + return 0; +} + +/* TODO: Enable this function when stat-tables will be revived. */ +static inline void +sqlStat4ProbeFree(struct UnpackedRecord *rec) +{ + (void)rec; +} + +/* TODO: Enable this function when stat-tables will be revived. */ +static inline int sql_stat4_column(struct sql *db, const char *record, uint32_t col_num, - sql_value **res); + struct Mem **res) +{ + (void)db; + (void)record; + (void)col_num; + (void)res; + return 0; +} /* * The interface to the LEMON-generated parser diff --git a/src/box/sql/vdbemem.c b/src/box/sql/vdbemem.c index 85d620a0a..263fe5b00 100644 --- a/src/box/sql/vdbemem.c +++ b/src/box/sql/vdbemem.c @@ -44,6 +44,8 @@ #include "box/tuple.h" #include "mpstream/mpstream.h" +#if 0 + /* * Context object passed by sqlStat4ProbeSetValue() through to * valueNew(). See comments above valueNew() for details. @@ -523,6 +525,22 @@ sqlStat4ValueFromExpr(Parse * pParse, /* Parse context */ return stat4ValueFromExpr(pParse, pExpr, type, 0, ppVal); } +/** + * Extract the col_num-th column from the record. Write + * the column value into *res. If *res is initially NULL + * then a new sql_value object is allocated. + * + * If *res is initially NULL then the caller is responsible for + * ensuring that the value written into *res is eventually + * freed. + * + * @param db Database handle. + * @param record Pointer to buffer containing record. + * @param col_num Column to extract. + * @param[out] res Extracted value. + * + * @retval -1 on error or 0. + */ int sql_stat4_column(struct sql *db, const char *record, uint32_t col_num, sql_value **res) @@ -565,3 +583,5 @@ sqlStat4ProbeFree(UnpackedRecord * pRec) sqlDbFree(aMem[0].db, pRec); } } + +#endif -- 2.25.1