[tarantool-patches] Re: [PATCH v3 7/9] sql: get rid of FuncDef function hash

Konstantin Osipov kostja at tarantool.org
Tue Aug 20 16:47:50 MSK 2019


* Kirill Shcherbatov <kshcherbatov at 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




More information about the Tarantool-patches mailing list