From: Konstantin Osipov <kostja@tarantool.org> To: Kirill Shcherbatov <kshcherbatov@tarantool.org> Cc: tarantool-patches@freelists.org, korablev@tarantool.org Subject: [tarantool-patches] Re: [PATCH v2 08/12] sql: rfc for SQL and Lua functions Date: Wed, 10 Jul 2019 22:17:05 +0300 [thread overview] Message-ID: <20190710191705.GI5619@atlas> (raw) In-Reply-To: <53e0ef51750696b33729dfcb38a269f1ee159112.1562756438.git.kshcherbatov@tarantool.org> * Kirill Shcherbatov <kshcherbatov@tarantool.org> [19/07/10 14:02]: > Part of #4182 > +4. name: ``stuid``\ setuid > +7. name: ``routine_type``\ > + type: ``string``\ > + default: ``FUNCTION``\ > + Type of registered object: `FUNCTION` or `PROCEDURE`; The procedure is a function that never returns result. > + > +The function creation process is also could be unsafe. To is also -> also > assemble a new function object, we must evaluate an expression > given by use, that could be `body = 'fiber.yield()'` instead of supplied by a user, that -> which > `body = 'function() return fiber.yield() end`. Therefore an > assemble of a function object require own empty sandbox. require -> requires own -> an own > +SQL defines some names for builtins. They are: > +``` > + TRIM, TYPEOF, PRINTF, UNICODE, CHAR, HEX, VERSION, > + QUOTE, REPLACE, SUBSTR, GROUP_CONCAT, JULIANDAY, DATE, > + TIME, DATETIME, STRFTIME, CURRENT_TIME, CURRENT_TIMESTAMP, > + CURRENT_DATE, LENGTH, POSITION, ROUND, UPPER, LOWER, > + IFNULL, RANDOM, CEIL, CEILING, CHARACTER_LENGTH, > + CHAR_LENGTH, FLOOR, MOD, OCTET_LENGTH, ROW_COUNT, COUNT, > + LIKE, ABS, EXP, LN, POWER, SQRT, SUM, TOTAL, AVG, > + RANDOMBLOB, NULLIF, ZEROBLOB, MIN, MAX, COALESCE, EVERY, > + EXISTS, EXTRACT, SOME, GREATER, LESSER > +``` > +(the functions are currently not implemented in Tarantool but must be implemented in future) > + > +We must forbid such names for `box.schema.func.create` endpoint to prevent a mess in SQL code. > +To solve this problem, we may set `collation = 'unicode_ci'` for ``_func.name`` field and put all built-ins in bootstrap image. > + > +We also reserve service SQL method names > +``` > + _sql_stat_get, _sql_stat_push, _sql_stat_init > +``` What if I create TyPeOf function? Will this be allowed? The spec generally looks good to me, but I don't see how you addressed the case sensitivity issue. Please add name_ucase field to the _func definition, and add a unique index over it, to prevent duplicates with a differently cased name. -- Konstantin Osipov, Moscow, Russia
next prev parent reply other threads:[~2019-07-10 19:17 UTC|newest] Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-07-10 11:00 [tarantool-patches] [PATCH v2 00/12] sql: uniform SQL and Lua functions subsystem Kirill Shcherbatov 2019-07-10 11:00 ` [tarantool-patches] [PATCH v2 01/12] sql: get rid of SOUNDEX, MATCH Kirill Shcherbatov 2019-07-10 18:45 ` [tarantool-patches] " Konstantin Osipov 2019-07-12 8:44 ` Kirill Yukhin 2019-07-10 11:00 ` [tarantool-patches] [PATCH v2 10/12] sql: refactor builtins signatures with port Kirill Shcherbatov 2019-07-10 18:47 ` [tarantool-patches] " Konstantin Osipov 2019-07-11 7:33 ` Kirill Shcherbatov 2019-07-10 11:00 ` [tarantool-patches] [PATCH v2 11/12] box: use own vtab per each function object Kirill Shcherbatov 2019-07-10 11:01 ` [tarantool-patches] [PATCH v2 12/12] sql: use schema's func hash instead of FuncDef hash Kirill Shcherbatov 2019-07-10 20:22 ` [tarantool-patches] " Konstantin Osipov 2019-07-10 11:01 ` [tarantool-patches] [PATCH v2 02/12] sql: get rid of LIKELY, UNLIKELY and LIKEHOOD Kirill Shcherbatov 2019-07-10 19:02 ` [tarantool-patches] " Konstantin Osipov 2019-07-11 7:38 ` Kirill Shcherbatov 2019-07-10 11:01 ` [tarantool-patches] [PATCH v2 03/12] sql: put analyze helpers to FuncDef cache Kirill Shcherbatov 2019-07-10 19:04 ` [tarantool-patches] " Konstantin Osipov 2019-07-12 8:47 ` Kirill Yukhin 2019-07-10 11:01 ` [tarantool-patches] [PATCH v2 04/12] sql: rework LIKE case-insensitive mode Kirill Shcherbatov 2019-07-10 19:09 ` [tarantool-patches] " Konstantin Osipov 2019-07-10 11:01 ` [tarantool-patches] [PATCH v2 05/12] sql: replace bool is_derived_coll marker with flag Kirill Shcherbatov 2019-07-10 19:10 ` [tarantool-patches] " Konstantin Osipov 2019-07-12 8:48 ` Kirill Yukhin 2019-07-10 11:01 ` [tarantool-patches] [PATCH v2 06/12] sql: remove SQL_PreferBuiltin flag Kirill Shcherbatov 2019-07-10 19:11 ` [tarantool-patches] " Konstantin Osipov 2019-07-10 11:01 ` [tarantool-patches] [PATCH v2 07/12] sql: move LIKE UConverter object to collation library Kirill Shcherbatov 2019-07-12 8:49 ` [tarantool-patches] " Kirill Yukhin 2019-07-10 11:01 ` [tarantool-patches] [PATCH v2 08/12] sql: rfc for SQL and Lua functions Kirill Shcherbatov 2019-07-10 19:17 ` Konstantin Osipov [this message] 2019-07-10 19:18 ` [tarantool-patches] " Konstantin Osipov 2019-07-11 7:40 ` Kirill Shcherbatov 2019-07-11 13:59 ` Kirill Yukhin 2019-07-10 11:01 ` [tarantool-patches] [PATCH v2 09/12] box: introduce Lua persistent functions Kirill Shcherbatov 2019-07-10 19:26 ` [tarantool-patches] " Konstantin Osipov 2019-07-12 21:49 ` Konstantin Osipov 2019-07-13 13:55 ` Kirill Yukhin 2019-07-13 14:17 ` Kirill Yukhin
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=20190710191705.GI5619@atlas \ --to=kostja@tarantool.org \ --cc=korablev@tarantool.org \ --cc=kshcherbatov@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='[tarantool-patches] Re: [PATCH v2 08/12] sql: rfc for SQL and Lua functions' \ /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