lua redis.call(...) 与 redis 中的相同调用不同

标签 lua redis

考虑代码:

redis> RPUSH test 1
(integer) 1
redis> RPUSH test 2
(integer) 2
redis> RPUSH test 19
(integer) 3
redis> RPUSH test 20
(integer) 4
redis> RPUSH test 3
(integer) 5
redis> SORT test BY nosort
1) "1"
2) "2"
3) "19"
4) "20"
5) "3"
redis 127.0.0.1:6379> eval "return redis.call('SORT', 'test', 'BY', 'nosort')" 0
1) "1"
2) "19"
3) "2"
4) "20"
5) "3"
redis 127.0.0.1:6379>

相同的操作,但 lua 返回排序顺序损坏的列表。这是一个错误吗?

我使用redis-2.6.0-rc7

最佳答案

是的,这是一个错误,并且 it is fixed in Git trunk .

关于lua redis.call(...) 与 redis 中的相同调用不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12643143/

相关文章:

arrays - 如何在lua中循环遍历二维数组

opengl - 使用 premake4 构建项目文件 - 如何?

function - 在lua中调用未定义的函数时收到任何通知

ruby - Redis 无法使用 redis-rb 连接(使用 Redistogo URL)

Lua - 访问文件和控制应用程序?

lua - lua中通过index-value比较两个索引表

php - 使用分页过滤REDIS中的在线用户

c# - 使用 StackExchange.Redis 处理暂时性网络错误

RedisInsight 包含恶意软件

node.js - 并发请求覆盖 ​​Redis 中的数据