Tarantool development patches archive
 help / color / mirror / Atom feed
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 v3 7/9] sql: get rid of FuncDef function hash
Date: Tue, 20 Aug 2019 16:47:50 +0300	[thread overview]
Message-ID: <20190820134750.GA12831@atlas> (raw)
In-Reply-To: <52e011b5-fe1c-6731-2726-c7d2d3f65e05@tarantool.org>

* Kirill Shcherbatov <kshcherbatov@tarantool.org> [19/08/19 18:55]:
>  src/box/alter.cc             |   6 +
> index 4f2e34bf0..22d3040ef 100644
> --- a/src/box/alter.cc
> +++ b/src/box/alter.cc
> @@ -2926,6 +2926,12 @@ on_replace_dd_func(struct trigger * /* trigger */, void *event)
>  				  (unsigned) old_func->def->uid,
>  				  "function has references");
>  		}
> +		/* Can't' drop a builtin function. */
> +		if (old_func->def->language == FUNC_LANGUAGE_SQL_BUILTIN) {
> +			tnt_raise(ClientError, ER_DROP_FUNCTION,
> +				  (unsigned) old_func->def->uid,
> +				  "function is SQL builtin");
> +		}

I remember we discussed a safety net which adds a flag
"is_persistent" to sql_func_builtin, asserts this flag is set
whenever the function is used in SQL, and sets this flag in
alter.cc on_replace trigger.

this safety net can go in a separate patch.

Otherwise lgtm.


-- 
Konstantin Osipov, Moscow, Russia

  reply	other threads:[~2019-08-20 13:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-16 13:26 [tarantool-patches] [PATCH v3 0/9] sql: uniform SQL and Lua functions subsystem Kirill Shcherbatov
2019-08-16 13:26 ` [tarantool-patches] [PATCH v3 1/9] sql: remove SQL_PreferBuiltin flag Kirill Shcherbatov
2019-08-16 13:26 ` [tarantool-patches] [PATCH v3 2/9] sql: GREATEST, LEAST instead of MIN/MAX overload Kirill Shcherbatov
2019-08-16 18:57   ` [tarantool-patches] " n.pettik
2019-08-16 13:26 ` [tarantool-patches] [PATCH v3 3/9] sql: wrap all trim functions in dispatcher Kirill Shcherbatov
2019-08-16 13:26 ` [tarantool-patches] [PATCH v3 4/9] sql: rework SQL_FUNC_COUNT flag semantics Kirill Shcherbatov
2019-08-16 18:55   ` [tarantool-patches] " n.pettik
2019-08-16 13:26 ` [tarantool-patches] [PATCH v3 5/9] sql: rename OP_Function to OP_BuiltinFunction Kirill Shcherbatov
2019-08-16 13:26 ` [tarantool-patches] [PATCH v3 6/9] sql: remove SQL_FUNC_SLOCHNG flag Kirill Shcherbatov
2019-08-16 18:54   ` [tarantool-patches] " n.pettik
2019-08-16 13:26 ` [tarantool-patches] [PATCH v3 7/9] sql: get rid of FuncDef function hash Kirill Shcherbatov
2019-08-16 14:09   ` [tarantool-patches] " Konstantin Osipov
2019-08-16 18:59     ` n.pettik
2019-08-19 15:51     ` Kirill Shcherbatov
2019-08-20 13:47       ` Konstantin Osipov [this message]
2019-08-20 19:04       ` n.pettik
2019-08-20 19:12         ` Konstantin Osipov
2019-08-16 13:26 ` [tarantool-patches] [PATCH v3 8/9] sql: get rid of box.internal.sql_function_create Kirill Shcherbatov
2019-08-16 13:26 ` [tarantool-patches] [PATCH v3 9/9] sql: better error messages on invalid arguments 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=20190820134750.GA12831@atlas \
    --to=kostja@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=kshcherbatov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v3 7/9] sql: get rid of FuncDef function hash' \
    /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