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
{If EXEC aborts
, the client MULTI state is cleared
} {
81 catch {r non-existing-command
}
84 assert_match
{EXECABORT
*} $e
88 test
{EXEC works on WATCHed key not modified
} {
96 test
{EXEC fail on WATCHed key modified
(1 key of
1 watched
)} {
105 test
{EXEC fail on WATCHed key modified
(1 key of
5 watched
)} {
114 test
{EXEC fail on WATCHed key modified by SORT with STORE even
if the result is empty
} {
118 r sort emptylist store foo
124 test
{After successful EXEC key is no longer watched
} {
136 test
{After failed EXEC key is no longer watched
} {
149 test
{It is possible to UNWATCH
} {
159 test
{UNWATCH when there is nothing watched works as expected
} {
163 test
{FLUSHALL is able to touch the watched keys
} {
172 test
{FLUSHALL does not touch non affected keys
} {
181 test
{FLUSHDB is able to touch the watched keys
} {
190 test
{FLUSHDB does not touch non affected keys
} {
199 test
{WATCH is able to remember the DB a key belongs to
} {
211 test
{WATCH will consider touched keys target of EXPIRE
} {
221 test
{WATCH will not consider touched expired keys
} {
232 test
{DISCARD should clear the WATCH dirty flag on the client
} {
242 test
{DISCARD should UNWATCH all the keys
} {