func: factor out func_def_new and func_def_delete
func_def_new takes function id, name, body, comment, and owner id and allocates a new func_def struct, setting the rest of the members to their default values. We need this function to create a new func_def object for handling space upgrade in read view. Note, this isn't a pure refactoring - before this patch, we used FUNC_LANGUAGE_LUA for SQL builtin functions, which were deprecated in 2.9. This worked fine, because we never actually called them - it was needed solely for upgrade from older versions. In this commit, we create an SQL builtin function just like any other function, but set its vtab to a dummy, which raises an error on an attempt to call it. This should make the code clearer. Needed for https://github.com/tarantool/tarantool-ee/issues/163 NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring
Showing
- src/box/alter.cc 38 additions, 100 deletionssrc/box/alter.cc
- src/box/func.c 36 additions, 0 deletionssrc/box/func.c
- src/box/func_def.c 49 additions, 0 deletionssrc/box/func_def.c
- src/box/func_def.h 17 additions, 22 deletionssrc/box/func_def.h
- src/box/sql/func.c 4 additions, 17 deletionssrc/box/sql/func.c
- test/unit/func_cache.c 4 additions, 6 deletionstest/unit/func_cache.c
Loading
Please register or sign in to comment