Hi,
I am having issues getting the hiredis client to execute a loaded lua script. I am able to execute the script via redis-cli and get expected output, but not pragmatically using hiredis.
Not even SCRIPT EXISTS is properly returning.
when I issue:
1)
redis=redisCommand(ctx, "SCRIPT EXISTS 3a94e53b4b39b8229102c70d92a4ac3f6f8e3c1f");
I tested for all possible return values but only (redis->type == REDIS_REPLY_ARRAY) was true, but element[0]->str is NULL all other return types are false. The same command executed in redis-cli returns OK. I trapped the final protocol string and it seesm to be formatted correctly (see below)
2)
Attempting to run EVALSHA also fails in a very peculiar way:
redis=redisCommand(ctx, "EVALSHA %s 4 %d %d %d %d","3a94e53b4b39b8229102c70d92a4ac3f6f8e3c1f", 4095, 1, 1023, 1);
redis->elements returns '5' which is correct, as the lua script returns 5 values, but then accessing the array elements elment[0-4]->str are all NULL
The script works fine from redis-cli
Is there a special provision for running LUA scripts from hiredis?
'HIREDIS: cmd: '*3
$6
SCRIPT
$6
EXISTS
$40
3a94e53b4b39b8229102c70d92a4ac3f6f8e3c1f
'HIREDIS: cmd: '*7
$7
EVALSHA
$40
3a94e53b4b39b8229102c70d92a4ac3f6f8e3c1f
$1
4
$4
4095
$1
1
$4
1023
$1
1