The memcache protocol for increment says:<br><pre>  The data for the item is treated as decimal representation of a 64-bit<br> &nbsp;unsigned integer. If the current data value does not conform to such a<br> &nbsp;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.&nbsp; 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&#39;s no longer a serialized object and &quot;boom&quot;.<br>
<br>I propose we change this edge case of the protocol and make &quot;incr/decr&quot; return an error (either NOT_FOUND or NOT_NUMBER) if the value wasn&#39;t a decimal representation of a 64-bit unsigned integer.&nbsp; That is, the value must effectively match /\s*\d+\s*/.&nbsp; (not proposing we add a regex library dependency...)<br>
<br>Thoughts, objections?<br><br>Brad<br><br>