box: populate port_c with new types
We are going to use ports for triggers. The problem is there is no port implementation that meets all requirements to be used to pass arguments to triggers from C, so let's extend existing port_c. This port is already allows to be dumped several times - let's keep this invariant to call chains of triggers using only one port. Let's store trivial types directly, not packed in MsgPack. Then, we won't need to make a second mempool allocation to store them and we won't need to decode them to read. It's worth noting that port_c has two MsgPack types now - MP and MP_OBJECT. The first now is a MsgPack packet that will be unpacked on dump if it's possible. For example, we can pass a field of tuple, which is a MsgPack packet, to field constraint, and it will be unpacked when it will be dumped to Lua, so the constraint argument will have a Lua value, not MsgPack. On the other hand, we want to dump MsgPack as a MsgPack object sometimes. For instance, we use MsgPack object to pass request header and body to iproto override handlers and space recovery triggers. NO_CHANGELOG=internal NO_DOC=internal
Showing
- src/box/lua/misc.cc 43 additions, 8 deletionssrc/box/lua/misc.cc
- src/box/lua/schema.lua 26 additions, 4 deletionssrc/box/lua/schema.lua
- src/box/port.c 187 additions, 52 deletionssrc/box/port.c
- src/box/port.h 83 additions, 13 deletionssrc/box/port.h
- src/box/sql/func.c 4 additions, 3 deletionssrc/box/sql/func.c
- src/box/sql/mem.c 11 additions, 3 deletionssrc/box/sql/mem.c
- src/lib/core/port.h 1 addition, 1 deletionsrc/lib/core/port.h
- test/unit/port.cc 116 additions, 7 deletionstest/unit/port.cc
Loading
Please register or sign in to comment