Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing a lua debugger bug that prevented use of 'server' for server.call invocations. #303

Merged
merged 2 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,7 @@ ldbLog(sdsnew(" next line of code."));
luaPushError(lua, "script aborted for user request");
luaError(lua);
} else if (argc > 1 &&
(!strcasecmp(argv[0],"r") || !strcasecmp(argv[0],"redis"))) {
(!strcasecmp(argv[0],"r") || !strcasecmp(argv[0],REDIS_API_NAME) || !strcasecmp(argv[0],SERVER_API_NAME))) {
ldbRedis(lua,argv,argc);
ldbSendLogs();
} else if ((!strcasecmp(argv[0],"p") || !strcasecmp(argv[0],"print"))) {
Expand Down
13 changes: 13 additions & 0 deletions tests/unit/scripting.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -1547,6 +1547,19 @@ start_server {tags {"scripting needs:debug external:skip"}} {
reconnect
assert_equal [r ping] {PONG}
}

test {Test scripting debug lua server invocations} {
r script debug sync
r eval {return 'hello'} 0
set cmd "*2\r\n\$6\r\nserver\r\n\$4\r\nping\r\n"
r write $cmd
r flush
set ret [r read]
puts $ret
assert_match {*PONG*} $ret
reconnect
assert_equal [r ping] {PONG}
}
}

start_server {tags {"scripting external:skip"}} {
Expand Down