mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
6dd1693c0e
Lua arrays can't contain nil elements (see http://www.lua.org/pil/19.1.html for more information), so Lua scripts were not able to return a multi-bulk reply containing nil bulk elements inside. This commit introduces a special conversion: a table with just a "nilbulk" field set to a boolean value is converted by Redis as a nil bulk reply, but at the same time for Lua this type is not a "nil" so can be used inside Lua arrays. This type is also assigned to redis.NIL, so the following two forms are equivalent and will be able to return a nil bulk reply as second element of a three elements array: EVAL "return {1,redis.NIL,3}" 0 EVAL "return {1,{nilbulk=true},3}" 0 The result in redis-cli will be: 1) (integer) 1 2) (nil) 3) (integer) 3 |
||
---|---|---|
.. | ||
type | ||
aofrw.tcl | ||
auth.tcl | ||
basic.tcl | ||
bitops.tcl | ||
cas.tcl | ||
dump.tcl | ||
expire.tcl | ||
introspection.tcl | ||
limits.tcl | ||
maxmemory.tcl | ||
obuf-limits.tcl | ||
other.tcl | ||
printver.tcl | ||
protocol.tcl | ||
pubsub.tcl | ||
quit.tcl | ||
scripting.tcl | ||
slowlog.tcl | ||
sort.tcl |