Getset fix (#8118)
* Fixed SET GET executing on wrong type Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
This commit is contained in:
parent
3ba2281f96
commit
69b7113bb5
@ -90,7 +90,7 @@ void setGenericCommand(client *c, int flags, robj *key, robj *val, robj *expire,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flags & OBJ_SET_GET) {
|
if (flags & OBJ_SET_GET) {
|
||||||
getGenericCommand(c);
|
if (getGenericCommand(c) == C_ERR) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
genericSetKey(c,c->db,key,val,flags & OBJ_SET_KEEPTTL,1);
|
genericSetKey(c,c->db,key,val,flags & OBJ_SET_KEEPTTL,1);
|
||||||
|
@ -415,6 +415,14 @@ start_server {tags {"string"}} {
|
|||||||
list $err1 $err2
|
list $err1 $err2
|
||||||
} {*syntax err* *syntax err*}
|
} {*syntax err* *syntax err*}
|
||||||
|
|
||||||
|
test {Extended SET GET with incorrect type should result in wrong type error} {
|
||||||
|
r del foo
|
||||||
|
r rpush foo waffle
|
||||||
|
catch {r set foo bar GET} err1
|
||||||
|
assert_equal "waffle" [r rpop foo]
|
||||||
|
set err1
|
||||||
|
} {*WRONGTYPE*}
|
||||||
|
|
||||||
test {Extended SET EX option} {
|
test {Extended SET EX option} {
|
||||||
r del foo
|
r del foo
|
||||||
r set foo bar ex 10
|
r set foo bar ex 10
|
||||||
|
Loading…
x
Reference in New Issue
Block a user