From: Kirill Shcherbatov <kshcherbatov@tarantool.org> To: tarantool-patches@freelists.org, korablev@tarantool.org Cc: kostja@tarantool.org, vdavydov.dev@gmail.com, Kirill Shcherbatov <kshcherbatov@tarantool.org> Subject: [PATCH v1 10/12] sql: remove SQL_PreferBuiltin flag Date: Mon, 8 Jul 2019 14:26:16 +0300 [thread overview] Message-ID: <98cecfef619fddd6ee5df67f29a4e5c95f88c588.1562584567.git.kshcherbatov@tarantool.org> (raw) In-Reply-To: <cover.1562584567.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/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 11e7596d1..ce15500e5 100644 --- a/src/box/sql/sqlInt.h +++ b/src/box/sql/sqlInt.h @@ -1104,7 +1104,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
next prev parent reply other threads:[~2019-07-08 11:26 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-07-08 11:26 [PATCH v1 00/12] sql: uniform SQL and Lua functions subsystem Kirill Shcherbatov 2019-07-08 11:26 ` [PATCH v1 01/12] sql: rfc for SQL and Lua functions Kirill Shcherbatov 2019-07-08 11:26 ` Kirill Shcherbatov [this message] 2019-07-08 11:26 ` [PATCH v1 11/12] sql: move LIKE UConverter object to collation library Kirill Shcherbatov 2019-07-08 11:26 ` [PATCH v1 12/12] sql: use schema's func hash instead of FuncDef hash Kirill Shcherbatov 2019-07-08 11:26 ` [PATCH v1 02/12] sql: get rid of SOUNDEX, MATCH Kirill Shcherbatov 2019-07-08 11:26 ` [PATCH v1 03/12] sql: get rid of LIKELY, UNLIKELY and LIKEHOOD Kirill Shcherbatov 2019-07-08 11:26 ` [PATCH v1 04/12] box: introduce Lua persistent functions Kirill Shcherbatov 2019-07-08 11:26 ` [PATCH v1 05/12] sql: put analyze helpers to FuncDef cache Kirill Shcherbatov 2019-07-09 15:56 ` [tarantool-patches] " n.pettik 2019-07-08 11:26 ` [PATCH v1 06/12] sql: rework LIKE case-insensitive mode Kirill Shcherbatov 2019-07-08 11:26 ` [PATCH v1 07/12] sql: replace bool is_derived_coll marker with flag Kirill Shcherbatov 2019-07-09 16:13 ` [tarantool-patches] " n.pettik 2019-07-08 11:26 ` [PATCH v1 08/12] sql: refactor builtins signatures with port Kirill Shcherbatov 2019-07-08 11:26 ` [PATCH v1 09/12] box: use own vtab per each function object Kirill Shcherbatov
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=98cecfef619fddd6ee5df67f29a4e5c95f88c588.1562584567.git.kshcherbatov@tarantool.org \ --to=kshcherbatov@tarantool.org \ --cc=korablev@tarantool.org \ --cc=kostja@tarantool.org \ --cc=tarantool-patches@freelists.org \ --cc=vdavydov.dev@gmail.com \ --subject='Re: [PATCH v1 10/12] 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