Lua: mature the implementation CALL command in the binary protocol.
Fix a bug when Lua transaction was rolled back twice when Lua procedure was invoked from CALL. Change the way arguments to and from CALL statement in the binary protocol are passed: we used to pass everything from the wire as a single binary blob. Now every field of the received tuple is passed in as a separate string argument. Everything passed back from Lua is converted to a tuple. This makes CALL response similar to one of SELECT. Improve box.pack() to convert its argument to integer when necessary. Add an argument count check to box.pack(). Additionally, now box.pack() can be used to pack operations of 'UPDATE'. Use tarantool_lua_tostring() in iov_add_ret(): this function is now used to convert return values to the binary protocol in box_lua.m. This is necessary if we try to send boolean or nil over the binary wire, since Lua C API lua_tostring() does not convert them. Add box.lua - a system Lua script compiled into Tarantool and containing a bunch of Lua code preloaded at startup. Populate box.lua with implementation of basic Lua functions: box.select(), box.update(), box.replace(), box.insert() (currently an alias for box.replace()), box.delete(). They are all wrappers around box.process(). Move box_lua_init() to the beginning of mod_init(), since Lua in future can be used in recover(). Fix a wrong assumption about the contents of Lua stack in iov_add_multret(). Update sql.g Python SQL grammar to allow an empty argumeent list for procedure in CALL statement. Add initial documentation on Lua procedures. Add more Lua tests. Unrelated: rename INSERT to REPLACE, and UPDATE_FIELDS to UPDATE. Remove SELECT_LIMIT, which is not used any more.
Showing
- core/tarantool_lua.m 55 additions, 15 deletionscore/tarantool_lua.m
- doc/user/language-reference.xml 69 additions, 1 deletiondoc/user/language-reference.xml
- include/tarantool.h 3 additions, 0 deletionsinclude/tarantool.h
- mod/box/CMakeLists.txt 11 additions, 2 deletionsmod/box/CMakeLists.txt
- mod/box/box.h 4 additions, 5 deletionsmod/box/box.h
- mod/box/box.lua 51 additions, 0 deletionsmod/box/box.lua
- mod/box/box.m 15 additions, 15 deletionsmod/box/box.m
- mod/box/box_lua.m 63 additions, 34 deletionsmod/box/box_lua.m
- mod/box/memcached.m 1 addition, 1 deletionmod/box/memcached.m
- test/box/configuration.result 1 addition, 1 deletiontest/box/configuration.result
- test/box/lua.result 172 additions, 11 deletionstest/box/lua.result
- test/box/lua.test 54 additions, 4 deletionstest/box/lua.test
- test/box/show.result 2 additions, 2 deletionstest/box/show.result
- test/box/stat.result 2 additions, 2 deletionstest/box/stat.result
- test/box_big/lua.result 8 additions, 0 deletionstest/box_big/lua.result
- test/box_big/lua.test 4 additions, 0 deletionstest/box_big/lua.test
- test/box_big/tarantool.cfg 12 additions, 0 deletionstest/box_big/tarantool.cfg
- test/box_memcached/multiversioning.result 1 addition, 1 deletiontest/box_memcached/multiversioning.result
- test/lib/admin_connection.py 1 addition, 1 deletiontest/lib/admin_connection.py
- test/lib/sql.g 2 additions, 2 deletionstest/lib/sql.g
Loading
Please register or sign in to comment