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