Repository navigation
Commit 6dd1c5f
authored
fix: Memcached
* fix: MemcachedHandler::decrement() wrong sign on missing key
MemcachedHandler::decrement() passed $offset as Memcached::decrement()'s
initial_value, which is used as-is (not decremented from) when a key
doesn't exist yet. That made a fresh key end up at +$offset instead of
the -$offset every other cache handler (File, Redis, Predis) produces.
Memcached counters are unsigned, so they can't hold a negative initial
value the way the other handlers effectively can. Use 0 instead (also
Memcached::decrement()'s own default), so a fresh key at least stops
going the wrong direction.
Updates the existing MemcachedHandlerTest::testDecrement() expectation
and adds a changelog entry.
* fix: address review feedback on Memcached decrement() fix
* fix: correct expected type in MemcachedHandlerTest::testDecrementdecrement() gives the wrong sign on a missing key (#10512)1 parent b8866f2 commit 6dd1c5f
4 files changed
Lines changed: 17 additions & 4 deletions
File tree
- system/Cache/Handlers
- tests/system/Cache/Handlers
- user_guide_src/source
- changelogs
- libraries
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
184 | | - | |
185 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
186 | 188 | | |
187 | 189 | | |
188 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
155 | 160 | | |
156 | 161 | | |
157 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
215 | 220 | | |
216 | 221 | | |
217 | 222 | | |
| |||
0 commit comments