Skip to content

Commit

Permalink
Merge pull request #301 from sandyharvie/fix-type-conversion-bug-in-r…
Browse files Browse the repository at this point in the history
…edisToLua

fix type conversion bug in redisToLua
  • Loading branch information
alicebob authored Oct 31, 2022
2 parents 1d7ae5f + eb795a4 commit 1bcf722
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd_scripting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,16 @@ func TestCmdEvalReply(t *testing.T) {
),
)

mustOK(t, c,
"EVAL", `return redis.call("XGROUP", "CREATE", KEYS[1], ARGV[1], "$", "MKSTREAM")`,
"1", "stream", "group",
)
mustDo(t, c,
"EVAL", `return redis.call("XPENDING", KEYS[1], ARGV[1], "-", "+", 1, ARGV[2])`,
"1", "stream", "group", "consumer",
proto.Array(),
)

mustDo(t, c,
"EVAL", `return {err="broken"}`, "0",
proto.Error("broken"),
Expand Down
2 changes: 2 additions & 0 deletions lua.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ func redisToLua(l *lua.LState, res []interface{}) *lua.LTable {
v = lua.LFalse
} else {
switch et := e.(type) {
case int:
v = lua.LNumber(et)
case int64:
v = lua.LNumber(et)
case []uint8:
Expand Down

0 comments on commit 1bcf722

Please sign in to comment.