lua: fix operation type passing to on_replace triggers
This commit fixes a regression introduced by commit 5ab0763b (pass operation type to lua triggers) When passing operation type to the trigger, we relied on a corresponding xrow_header, which would later be written to the log. When before_replace triggers are fired, there is no row connected to the txn statement yet, so we faked one to pass operations. We, however, didn't account for temporary spaces, which never have a row associated with a corresponding txn stmt. This lead to a segfault on an attemt to use on_replace triggers with temporary spaces. Add a fake row for temporary spaces to pass operation type in on_replace triggers and add some tests. Closes #4266
Showing
- src/box/txn.c 18 additions, 1 deletionsrc/box/txn.c
- test/box/before_replace.result 25 additions, 0 deletionstest/box/before_replace.result
- test/box/before_replace.test.lua 15 additions, 0 deletionstest/box/before_replace.test.lua
- test/box/on_replace.result 25 additions, 0 deletionstest/box/on_replace.result
- test/box/on_replace.test.lua 15 additions, 0 deletionstest/box/on_replace.test.lua
Loading
Please register or sign in to comment