box: introduce SQL_EXPR to field constraints
After this patch, it will be possible to use the SQL_EXPR functions not only for tuple constraints, but also for field constraints. Needed for #6986 @TarantoolBot document Title: SQL_EXPR functions Now it is possible to create functions with `SQL_EXPR` language. The `body` field of the function definition is the SQL expression. Currently, these functions can only be used as constraints on tuples and fields, as there is no interface to define argument names and types otherwise. If the SQL_EXPR function is set as a constraint on a field, the function will throw a validation error if more than one variable is used in the function. However, the variable name of the only variable will only be checked if the SQL_EXPR function was created as a field constraint from SQL.
Showing
- changelogs/unreleased/gh-6986-introduce-sql-expr-functions.md 3 additions, 0 deletions...gelogs/unreleased/gh-6986-introduce-sql-expr-functions.md
- src/box/space.c 4 additions, 2 deletionssrc/box/space.c
- src/box/sql.c 19 additions, 7 deletionssrc/box/sql.c
- src/box/sql.h 13 additions, 0 deletionssrc/box/sql.h
- src/box/sql/expr.c 1 addition, 1 deletionsrc/box/sql/expr.c
- src/box/sql/func.c 33 additions, 19 deletionssrc/box/sql/func.c
- src/box/sql/vdbe.c 34 additions, 11 deletionssrc/box/sql/vdbe.c
- src/box/tuple_constraint_func.c 14 additions, 3 deletionssrc/box/tuple_constraint_func.c
- src/box/tuple_constraint_func.h 3 additions, 2 deletionssrc/box/tuple_constraint_func.h
- test/sql-luatest/sql_func_expr_test.lua 26 additions, 1 deletiontest/sql-luatest/sql_func_expr_test.lua
Loading
Please register or sign in to comment