From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
To: tarantool-patches@freelists.org, korablev@tarantool.org
Cc: Kirill Shcherbatov <kshcherbatov@tarantool.org>
Subject: [tarantool-patches] [PATCH v2 1/8] sql: remove SQL_PreferBuiltin flag
Date: Thu, 8 Aug 2019 17:50:45 +0300 [thread overview]
Message-ID: <d34d5fd9d82b946238fdeb8065bddbf7392d8730.1565275469.git.kshcherbatov@tarantool.org> (raw)
In-Reply-To: <cover.1565275469.git.kshcherbatov@tarantool.org>
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/sqlInt.h | 1 -
src/box/sql/callback.c | 9 +--------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h
index 87e5d22ee..4adb30c5c 100644
--- a/src/box/sql/sqlInt.h
+++ b/src/box/sql/sqlInt.h
@@ -1196,7 +1196,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 */
diff --git a/src/box/sql/callback.c b/src/box/sql/callback.c
index 49197532e..6c272de71 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);
@@ -210,10 +209,6 @@ sqlFindFunction(sql * db, /* An open database */
}
/* If no match is found, search the built-in functions.
- *
- * If the SQL_PreferBuiltin flag is set, then search the built-in
- * functions even if a prior app-defined function was found. And give
- * priority to built-in functions.
*
* Except, if createFlag is true, that means that we are trying to
* install a new function. Whatever FuncDef structure is returned it will
@@ -221,9 +216,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;
--
2.22.0
next prev parent reply other threads:[~2019-08-08 14:50 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-08 14:50 [tarantool-patches] [PATCH v2 0/8] sql: uniform SQL and Lua functions subsystem Kirill Shcherbatov
2019-08-08 14:50 ` Kirill Shcherbatov [this message]
2019-08-09 16:07 ` [tarantool-patches] Re: [PATCH v2 1/8] sql: remove SQL_PreferBuiltin flag n.pettik
2019-08-12 21:58 ` Konstantin Osipov
2019-08-08 14:50 ` [tarantool-patches] [PATCH v2 2/8] sql: GREATEST, LEAST instead of MIN/MAX overload Kirill Shcherbatov
2019-08-09 17:37 ` [tarantool-patches] " n.pettik
2019-08-13 8:26 ` Kirill Shcherbatov
2019-08-12 21:59 ` Konstantin Osipov
2019-08-08 14:50 ` [tarantool-patches] [PATCH v2 3/8] sql: wrap all trim functions in dispatcher Kirill Shcherbatov
2019-08-09 18:05 ` [tarantool-patches] " n.pettik
2019-08-13 8:28 ` Kirill Shcherbatov
2019-08-13 22:19 ` n.pettik
2019-08-12 22:00 ` Konstantin Osipov
2019-08-08 14:50 ` [tarantool-patches] [PATCH v2 4/8] sql: get rid of SQL_FUNC_COUNT flag Kirill Shcherbatov
2019-08-12 22:01 ` [tarantool-patches] " Konstantin Osipov
2019-08-13 20:35 ` n.pettik
2019-08-14 7:25 ` Kirill Shcherbatov
2019-08-08 14:50 ` [tarantool-patches] [PATCH v2 5/8] sql: introduce a signature_mask for functions Kirill Shcherbatov
2019-08-12 22:04 ` [tarantool-patches] " Konstantin Osipov
2019-08-13 8:32 ` Kirill Shcherbatov
2019-08-13 8:44 ` Konstantin Osipov
2019-08-13 20:38 ` n.pettik
2019-08-14 7:21 ` Kirill Shcherbatov
2019-08-08 14:50 ` [tarantool-patches] [PATCH v2 6/8] sql: rename OP_Function to OP_BuiltinFunction Kirill Shcherbatov
2019-08-12 22:04 ` [tarantool-patches] " Konstantin Osipov
2019-08-13 20:36 ` n.pettik
2019-08-08 14:50 ` [tarantool-patches] [PATCH v2 7/8] sql: get rid of FuncDef function hash Kirill Shcherbatov
2019-08-12 22:11 ` [tarantool-patches] " Konstantin Osipov
2019-08-13 7:29 ` Kirill Shcherbatov
2019-08-13 8:42 ` Konstantin Osipov
2019-08-13 9:45 ` Kirill Shcherbatov
2019-08-13 20:40 ` n.pettik
2019-08-16 12:57 ` Kirill Shcherbatov
2019-08-20 16:06 ` n.pettik
2019-08-08 14:50 ` [tarantool-patches] [PATCH v2 8/8] box: get rid of box.internal.sql_function_create Kirill Shcherbatov
2019-08-13 20:43 ` [tarantool-patches] " n.pettik
2019-08-16 12:57 ` Kirill Shcherbatov
2019-08-20 19:36 ` n.pettik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d34d5fd9d82b946238fdeb8065bddbf7392d8730.1565275469.git.kshcherbatov@tarantool.org \
--to=kshcherbatov@tarantool.org \
--cc=korablev@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='Re: [tarantool-patches] [PATCH v2 1/8] sql: remove SQL_PreferBuiltin flag' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox