2

I am getting a strange error with lua script while running it on redis cluster.

the following script

--if keyCount ~= 1 or  KEYS[1] == nil then

--end

throws error:

(error) ERR Error compiling script (new function): user_script:3: 'end' expected (to close 'function' at line 1) near '<eof>'

Following is the redis-cli command I am using:

./redis-cli -h HOST -p PORT SCRIPT LOAD "$(cat 2.lua)"

It looks like a bug to me, how come a fully commented script needs an 'end' at the end!! Has someone seen this?

PS: I am posting the most reduced version of script where I am able to reproduce the issue, actually faced it in much bigger script while putting the line comments. Putting the multi line comment like --[[]] solves the issue, but this shouldn't be occurring at the first place! I am using Lua 5.1 and redis 3.0.x

Prashant Mishra
  • 330
  • 4
  • 15

1 Answers1

1

Confirmed that its a bug with redis 3.0.5 (running Lua 5.1) , the issue is fixed in redis 3.0.7

Prashant Mishra
  • 330
  • 4
  • 15