1 start_server
{tags
{"multi"}} {
2 test
{MUTLI
/ EXEC basics
} {
8 set v1
[r
lrange mylist
0 -1]
12 } {QUEUED QUEUED
{{a b c
} PONG
}}
22 set v3
[r
lrange mylist
0 -1]
26 test
{Nested MULTI are not allowed
} {
34 test
{MULTI where commands alter argc
/argv
} {
38 list [r
exec] [r exists myset
]
41 test
{WATCH inside MULTI is not allowed
} {
44 catch {[r watch x
]} err
49 test
{EXEC fails
if there are errors
while queueing commands
#1} {
53 catch {r non-existing-command
}
56 assert_match
{EXECABORT
*} $e
57 list [r exists foo1
] [r exists foo2
]
60 test
{EXEC fails
if there are errors
while queueing commands
#2} {
61 set rd
[redis_deferring_client
]
65 $rd config
set maxmemory
1
66 catch {r lpush mylist myvalue
}
67 $rd config
set maxmemory
0
70 assert_match
{EXECABORT
*} $e
71 assert
{[$rd read] eq
{OK
}}
72 assert
{[$rd read] eq
{OK
}}
74 list [r exists foo1
] [r exists foo2
]
77 test
{EXEC works on WATCHed key not modified
} {
85 test
{EXEC fail on WATCHed key modified
(1 key of
1 watched
)} {
94 test
{EXEC fail on WATCHed key modified
(1 key of
5 watched
)} {
103 test
{EXEC fail on WATCHed key modified by SORT with STORE even
if the result is empty
} {
107 r sort emptylist store foo
113 test
{After successful EXEC key is no longer watched
} {
125 test
{After failed EXEC key is no longer watched
} {
138 test
{It is possible to UNWATCH
} {
148 test
{UNWATCH when there is nothing watched works as expected
} {
152 test
{FLUSHALL is able to touch the watched keys
} {
161 test
{FLUSHALL does not touch non affected keys
} {
170 test
{FLUSHDB is able to touch the watched keys
} {
179 test
{FLUSHDB does not touch non affected keys
} {
188 test
{WATCH is able to remember the DB a key belongs to
} {
200 test
{WATCH will consider touched keys target of EXPIRE
} {
210 test
{WATCH will not consider touched expired keys
} {
221 test
{DISCARD should clear the WATCH dirty flag on the client
} {
231 test
{DISCARD should UNWATCH all the keys
} {