lua: provide old trigger API with name
Triggers that were moved to the trigger registry accept trigger name as an optional argument and allow to set triggers using new key-value API. Let's provide triggers, that were not moved to the trigger registry yet, with the same functionality. For this purpose the main trigger setter, lbox_trigger_reset, is updated. Backward compatibility is a bit broken after this patch. Firstly, all the triggers were listed in order of their insertion, which is reversed order of their actual layout and call. Now they are listed in direct oreder of call. The patch changes API for all the triggers that were not moved to the trigger registry except for swim triggers - this case is a bit more complicated because of context that can be passed to the swim triggers. Note that argument `top` of `lbox_trigger_reset` is changed to `bottom` because all passed `top`s became irrelevant with the introduction of the third argument - changing it to `bottom` will help avoid a similar problem in the future. Along the way, make transactional triggers' error more descriptive and add box.session.on_access_denied to the test - it wasn't tested by mistake. Part of #6484 Part of #8659 NO_CHANGELOG=later NO_DOC=later
Showing
- src/box/lua/init.c 4 additions, 4 deletionssrc/box/lua/init.c
- src/lua/trigger.c 155 additions, 57 deletionssrc/lua/trigger.c
- src/lua/trigger.h 35 additions, 24 deletionssrc/lua/trigger.h
- test/app-tap/trigger.test.lua 4 additions, 5 deletionstest/app-tap/trigger.test.lua
- test/box-luatest/triggers_old_api_test.lua 31 additions, 0 deletionstest/box-luatest/triggers_old_api_test.lua
- test/engine/transaction.result 14 additions, 11 deletionstest/engine/transaction.result
- test/engine/transaction.test.lua 5 additions, 3 deletionstest/engine/transaction.test.lua
Loading
Please register or sign in to comment