diff --git a/src/box/func.c b/src/box/func.c index 637eeecfecdc372cde6e37f2d6c0ce5a4b92e78a..5528f176dd70be9e43ad9335bb2e553716e5bff1 100644 --- a/src/box/func.c +++ b/src/box/func.c @@ -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) { diff --git a/src/box/func_def.c b/src/box/func_def.c index 09b3cbf9994e12ece161bb056935abd462a2600d..41bef2ac7557eb7e38efc0540ca86c40c7e99b0b 100644 --- a/src/box/func_def.c +++ b/src/box/func_def.c @@ -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; }