From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id DF0FB2556D for ; Fri, 23 Aug 2019 11:02:18 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id THu6mp53F3BY for ; Fri, 23 Aug 2019 11:02:18 -0400 (EDT) Received: from smtp47.i.mail.ru (smtp47.i.mail.ru [94.100.177.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id B875624DFD for ; Fri, 23 Aug 2019 11:02:17 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH v4 3/4] sql: get rid of FuncDef function hash References: <154ee8ea11ae260254b71d32e1299f1272438af1.1566400979.git.kshcherbatov@tarantool.org> <17C6E71F-24DF-476D-B5FA-430AF34DC84D@tarantool.org> From: Kirill Shcherbatov Message-ID: Date: Fri, 23 Aug 2019 18:02:15 +0300 MIME-Version: 1.0 In-Reply-To: <17C6E71F-24DF-476D-B5FA-430AF34DC84D@tarantool.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org, "n.pettik" >> +#define SQL_FUNC_MAX 0x2000 > > Nit: extra diff. Fixed. >> + /** >> + * A VDBE-memory-compatible call method. >> + * SQL built-ins don't use func base class "call" >> + * method to provide a best performance for SQL requests. >> + * Access checks are redundant, because all SQL built-ins >> + * are predefined and are executed on SQL privilege level. > > Which doesn’t exist yet… I asked you to document or fix it. > Comment in source code is OK, but it should be present in > documentation as well. A new DocBot request in the commit message: @TarantoolBot document Title: SQL builtins priveleges All SQL built-ins are executed on SQL privilege level that is undefined yet. >> + ">= 2", nFarg); > > -> “more than one”/“at least two” > > What is more, you can move introduction of ER_FUNC_WRONG_… > to a separate auxiliary patch. > Nit: “at least one” Done. As an auxiliary patch. > Nit: personally I’d not skip members and fill in them allActually I don't like it, but I don't mind so I've implemented it. >> + /* Some builtins are not implemented yet. */ > > Please, left comment describing why we really do need this check. > I mean the fact that it disallows user to create random built-in functions. /* * All SQL built-in(s) (stubs) are defined in a snapshot. * Implementation-specific metadata is defined in * sql_builtins list. When a definition were not found * above, the function name is invalid, i.e. it is * not built-in function. */ "in SQL", nId, zId)); >> } else { > > Let’s avoid call of sql_func_by_signature(). Consider refactoring: > etc Okey, implemented. > Didn’t forget check that user can’t create manually built-ins? No, I didn't. There is corresponding test in the following commit.