The memcache protocol for increment says:<br><pre> The data for the item is treated as decimal representation of a 64-bit<br> unsigned integer. If the current data value does not conform to such a<br> representation, the commands behave as if the value were 0.</pre>
This bit me recently, unknowingly having a Python pickled (serialized) value in memcache when I thought I had an integer. So I was actually doing an increment on a serialized integer object, which memcache treats as a zero, not touching the flags, so when you fetch it back out, you try to deserialize it, but it's no longer a serialized object and "boom".<br>
<br>I propose we change this edge case of the protocol and make "incr/decr" return an error (either NOT_FOUND or NOT_NUMBER) if the value wasn't a decimal representation of a 64-bit unsigned integer. That is, the value must effectively match /\s*\d+\s*/. (not proposing we add a regex library dependency...)<br>
<br>Thoughts, objections?<br><br>Brad<br><br>