box: add an ability to disable CK constraints
Now it is possible to disable and enable ck constraints in LUA. This option is persistent. All ck constraints are constructed in enabled state when Tarantool is configured. This ability may be usefulwhen processed data is verified and constraints validation is not required. For instance, during casual recovery process there's no need to provide any checks since data is assumed to be consistent. Persisting is_enabled flag is an important feature. If the option is not stored the following scenario is possible: - the option is turned off - data is changed so that a constraint is violated - the system is restarted while the option state is lost - there is no way (even in theory) to discover it and find that data is incorrect. Part of #4244
Showing
- src/box/alter.cc 29 additions, 6 deletionssrc/box/alter.cc
- src/box/bootstrap.snap 0 additions, 0 deletionssrc/box/bootstrap.snap
- src/box/ck_constraint.c 4 additions, 2 deletionssrc/box/ck_constraint.c
- src/box/ck_constraint.h 7 additions, 1 deletionsrc/box/ck_constraint.h
- src/box/lua/schema.lua 15 additions, 1 deletionsrc/box/lua/schema.lua
- src/box/lua/space.cc 3 additions, 0 deletionssrc/box/lua/space.cc
- src/box/lua/upgrade.lua 13 additions, 0 deletionssrc/box/lua/upgrade.lua
- src/box/schema_def.h 1 addition, 0 deletionssrc/box/schema_def.h
- src/box/sql/build.c 6 additions, 5 deletionssrc/box/sql/build.c
- test/box-py/bootstrap.result 2 additions, 1 deletiontest/box-py/bootstrap.result
- test/box/access_misc.result 69 additions, 68 deletionstest/box/access_misc.result
- test/sql/checks.result 88 additions, 20 deletionstest/sql/checks.result
- test/sql/checks.test.lua 40 additions, 17 deletionstest/sql/checks.test.lua
- test/sql/errinj.result 6 additions, 6 deletionstest/sql/errinj.result
- test/sql/errinj.test.lua 6 additions, 6 deletionstest/sql/errinj.test.lua
Loading
Please register or sign in to comment