Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
60d5ef4d
Unverified
Commit
60d5ef4d
authored
Feb 25, 2021
by
sundb
Committed by
GitHub
Feb 24, 2021
Browse files
Use addReplyErrorObject with shared.noscripterr (#8544)
parent
21316d57
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/scripting.c
View file @
60d5ef4d
...
@@ -1544,7 +1544,7 @@ void evalGenericCommand(client *c, int evalsha) {
...
@@ -1544,7 +1544,7 @@ void evalGenericCommand(client *c, int evalsha) {
* return an error. */
* return an error. */
if
(
evalsha
)
{
if
(
evalsha
)
{
lua_pop
(
lua
,
1
);
/* remove the error handler from the stack. */
lua_pop
(
lua
,
1
);
/* remove the error handler from the stack. */
addReply
(
c
,
shared
.
noscripterr
);
addReply
ErrorObject
(
c
,
shared
.
noscripterr
);
return
;
return
;
}
}
if
(
luaCreateFunction
(
c
,
lua
,
c
->
argv
[
1
])
==
NULL
)
{
if
(
luaCreateFunction
(
c
,
lua
,
c
->
argv
[
1
])
==
NULL
)
{
...
@@ -1695,7 +1695,7 @@ void evalShaCommand(client *c) {
...
@@ -1695,7 +1695,7 @@ void evalShaCommand(client *c) {
* not the right length. So we return an error ASAP, this way
* not the right length. So we return an error ASAP, this way
* evalGenericCommand() can be implemented without string length
* evalGenericCommand() can be implemented without string length
* sanity check */
* sanity check */
addReply
(
c
,
shared
.
noscripterr
);
addReply
ErrorObject
(
c
,
shared
.
noscripterr
);
return
;
return
;
}
}
if
(
!
(
c
->
flags
&
CLIENT_LUA_DEBUG
))
if
(
!
(
c
->
flags
&
CLIENT_LUA_DEBUG
))
...
...
tests/unit/info.tcl
View file @
60d5ef4d
...
@@ -62,6 +62,19 @@ start_server {tags {"info"}} {
...
@@ -62,6 +62,19 @@ start_server {tags {"info"}} {
assert_equal
[
s total_error_replies
]
2
assert_equal
[
s total_error_replies
]
2
}
}
test
{
errorstats: failed call NOSCRIPT error
}
{
r config resetstat
assert_equal
[
s total_error_replies
]
0
assert_match
{}
[
errorstat NOSCRIPT
]
catch
{
r evalsha NotValidShaSUM 0
}
e
assert_match
{
NOSCRIPT*
}
$e
assert_match
{
*count=1*
}
[
errorstat NOSCRIPT
]
assert_match
{
*calls=1,*,rejected_calls=0,failed_calls=1
}
[
cmdstat evalsha
]
assert_equal
[
s total_error_replies
]
1
r config resetstat
assert_match
{}
[
errorstat NOSCRIPT
]
}
test
{
errorstats: failed call NOGROUP error
}
{
test
{
errorstats: failed call NOGROUP error
}
{
r config resetstat
r config resetstat
assert_match
{}
[
errorstat NOGROUP
]
assert_match
{}
[
errorstat NOGROUP
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment