You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I was trying to send an EVAL script that takes as argument a possibly null value, but it seems the type dispatch here does not allow it. If I understand correctly, passing an empty string is prepended by 0 (the length) and thus do not match Redis' .
My script (a Lua implementation of a kind of CAS):
local w = redis.call('GET', ARGV[1]);
if (w == ARGV[2]) then
redis.call('SET', ARGV[3], ARGV[4]);
end;
return w;
Steps to reproduce it:
scheme@(guile-user)> (display script)
local w = redis.call('GET', ARGV[1]);
if (w == ARGV[2]) then
return "OK";
else
return "NOK";
end;
scheme@(guile-user)> (use-modules (redis))
scheme@(guile-user)> (define cnx (redis-connect))
scheme@(guile-user)> (redis-send cnx (eval (list script 0 0 "")))
$8 = "NOK"
scheme@(guile-user)> (redis-send cnx (eval (list script 0 0 '())))
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Throw to key `redis-invalid' with args `()'.
Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
Hi there, I was trying to send an EVAL script that takes as argument a possibly null value, but it seems the type dispatch here does not allow it. If I understand correctly, passing an empty string is prepended by
0
(the length) and thus do not match Redis' .My script (a Lua implementation of a kind of CAS):
Steps to reproduce it:
I also tried the following (after this doc):
My script works for non-null values:
The text was updated successfully, but these errors were encountered: