Skip to content
Snippets Groups Projects
Commit 212c5742 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

func: consolidate func_def checks in func_def_chekc

A follow up on #4182
parent 200a492a
No related branches found
No related tags found
No related merge requests found
......@@ -389,12 +389,6 @@ struct func *
func_sql_builtin_new(struct func_def *def)
{
assert(def->language == FUNC_LANGUAGE_SQL_BUILTIN);
if (def->body != NULL || def->is_sandboxed) {
diag_set(ClientError, ER_CREATE_FUNCTION, def->name,
"body and is_sandboxed options are not compatible "
"with SQL language");
return NULL;
}
struct func *func =
(struct func *) malloc(sizeof(*func));
if (func == NULL) {
......
......@@ -99,6 +99,14 @@ func_def_check(struct func_def *def)
return -1;
}
break;
case FUNC_LANGUAGE_SQL_BUILTIN:
if (def->body != NULL || def->is_sandboxed) {
diag_set(ClientError, ER_CREATE_FUNCTION, def->name,
"body and is_sandboxed options are not compatible "
"with SQL language");
return -1;
}
break;
default:
break;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment