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 0897B2343A for ; Wed, 10 Jul 2019 07:01:17 -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 I4tBKbqc1sJf for ; Wed, 10 Jul 2019 07:01:16 -0400 (EDT) Received: from smtp60.i.mail.ru (smtp60.i.mail.ru [217.69.128.40]) (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 BC79821D03 for ; Wed, 10 Jul 2019 07:01:16 -0400 (EDT) From: Kirill Shcherbatov Subject: [tarantool-patches] [PATCH v2 06/12] sql: remove SQL_PreferBuiltin flag Date: Wed, 10 Jul 2019 14:01:05 +0300 Message-Id: <9ed4f361a9750f7f5355af7a7dccfdb88856166f.1562756438.git.kshcherbatov@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 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, korablev@tarantool.org Cc: kostja@tarantool.org, Kirill Shcherbatov The SQL_PreferBuiltin flag is redundant (because builtin names are forbidden for UDFs) so we may to remove it. Needed for #4113, #2200, #2233 --- src/box/sql/callback.c | 5 +---- src/box/sql/sqlInt.h | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/box/sql/callback.c b/src/box/sql/callback.c index 49197532e..42fec2c6a 100644 --- a/src/box/sql/callback.c +++ b/src/box/sql/callback.c @@ -191,7 +191,6 @@ sqlFindFunction(sql * db, /* An open database */ int bestScore = 0; /* Score of best match */ int h; /* Hash value */ int nName; /* Length of the name */ - struct session *user_session = current_session(); assert(nArg >= (-2)); assert(nArg >= (-1) || createFlag == 0); @@ -221,9 +220,7 @@ sqlFindFunction(sql * db, /* An open database */ * new function. But the FuncDefs for built-in functions are read-only. * So we must not search for built-ins when creating a new function. */ - if (!createFlag && - (pBest == 0 - || (user_session->sql_flags & SQL_PreferBuiltin) != 0)) { + if (!createFlag && (pBest == NULL)) { bestScore = 0; h = (sqlUpperToLower[(u8) zName[0]] + nName) % SQL_FUNC_HASH_SZ; diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h index d6a46e534..515fce3a9 100644 --- a/src/box/sql/sqlInt.h +++ b/src/box/sql/sqlInt.h @@ -1157,7 +1157,6 @@ struct sql { #define SQL_ReverseOrder 0x00020000 /* Reverse unordered SELECTs */ #define SQL_RecTriggers 0x00040000 /* Enable recursive triggers */ #define SQL_AutoIndex 0x00100000 /* Enable automatic indexes */ -#define SQL_PreferBuiltin 0x00200000 /* Preference to built-in funcs */ #define SQL_EnableTrigger 0x01000000 /* True to enable triggers */ #define SQL_DeferFKs 0x02000000 /* Defer all FK constraints */ #define SQL_VdbeEQP 0x08000000 /* Debug EXPLAIN QUERY PLAN */ -- 2.21.0