Skip to content
Snippets Groups Projects
Commit 58f5c07e authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

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.
parent 99ad6ef6
No related branches found
No related tags found
Loading
Showing
with 531 additions and 97 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment