nrk / redis-lua

A Lua client library for the redis key value storage system.
MIT License
731 stars 239 forks source link

`nil` as key in `:set()` hangs the connection #49

Closed Habbie closed 7 years ago

Habbie commented 7 years ago
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> redis =require 'redis'
> r = redis.connect()
> =r:get('foo')
bar
> r:set(nil, 'bar')

it never returns. On the wire we see

*3
$3
SET
$3
bar

i.e. the key is simply skipped and Redis is waiting for the third argument.

Version is 2.0.4-1 from luarocks.

Habbie commented 7 years ago

v2.0.5:

  • Fixed command serialization when command arguments contain nil values.
Habbie commented 7 years ago

(For reference: duplicate of #29)