add and replace commands always expect response STORED
Bug #684689 reported by
Michal Linhard
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python Memcached |
Won't Fix
|
Medium
|
Michal Linhard |
Bug Description
memcached add command can also result to answer NOT_STORED
when the key exists in the cache
and replace command may result to answer NOT_STORED when the key is not present.
see following scenarios:
$ echo -e "set a 0 0 1\r\n1\r" | nc test1 11211
STORED
$ echo -e "add a 0 0 1\r\n1\r" | nc test1 11211
NOT_STORED
$ echo -e "replace b 0 0 1\r\n1\r" | nc test1 11211
NOT_STORED
these cases are not considered by python-memcached library version 1.45
To post a comment you must log in.
I believe the Python code returns True when STORED is returned and False when NOT_STORED is returned. This seems valid to me in these cases, are you proposing something else should be done?