Index: trunk/phase3/includes/objectcache/SqlBagOStuff.php |
— | — | @@ -133,7 +133,7 @@ |
134 | 134 | if ( $this->isExpired( $row->exptime ) ) { |
135 | 135 | $this->debug( "get: key has expired, deleting" ); |
136 | 136 | try { |
137 | | - $db->begin(); |
| 137 | + $db->begin( __METHOD__ ); |
138 | 138 | # Put the expiry time in the WHERE condition to avoid deleting a |
139 | 139 | # newly-inserted value |
140 | 140 | $db->delete( $tableName, |
— | — | @@ -141,7 +141,7 @@ |
142 | 142 | 'keyname' => $key, |
143 | 143 | 'exptime' => $row->exptime |
144 | 144 | ), __METHOD__ ); |
145 | | - $db->commit(); |
| 145 | + $db->commit( __METHOD__ ); |
146 | 146 | } catch ( DBQueryError $e ) { |
147 | 147 | $this->handleWriteError( $e ); |
148 | 148 | } |
— | — | @@ -170,7 +170,7 @@ |
171 | 171 | $encExpiry = $db->timestamp( $exptime ); |
172 | 172 | } |
173 | 173 | try { |
174 | | - $db->begin(); |
| 174 | + $db->begin( __METHOD__ ); |
175 | 175 | // (bug 24425) use a replace if the db supports it instead of |
176 | 176 | // delete/insert to avoid clashes with conflicting keynames |
177 | 177 | $db->replace( |
— | — | @@ -181,7 +181,7 @@ |
182 | 182 | 'value' => $db->encodeBlob( $this->serialize( $value ) ), |
183 | 183 | 'exptime' => $encExpiry |
184 | 184 | ), __METHOD__ ); |
185 | | - $db->commit(); |
| 185 | + $db->commit( __METHOD__ ); |
186 | 186 | } catch ( DBQueryError $e ) { |
187 | 187 | $this->handleWriteError( $e ); |
188 | 188 | |
— | — | @@ -195,12 +195,12 @@ |
196 | 196 | $db = $this->getDB(); |
197 | 197 | |
198 | 198 | try { |
199 | | - $db->begin(); |
| 199 | + $db->begin( __METHOD__ ); |
200 | 200 | $db->delete( |
201 | 201 | $this->getTableByKey( $key ), |
202 | 202 | array( 'keyname' => $key ), |
203 | 203 | __METHOD__ ); |
204 | | - $db->commit(); |
| 204 | + $db->commit( __METHOD__ ); |
205 | 205 | } catch ( DBQueryError $e ) { |
206 | 206 | $this->handleWriteError( $e ); |
207 | 207 | |
— | — | @@ -216,7 +216,7 @@ |
217 | 217 | $step = intval( $step ); |
218 | 218 | |
219 | 219 | try { |
220 | | - $db->begin(); |
| 220 | + $db->begin( __METHOD__ ); |
221 | 221 | $row = $db->selectRow( |
222 | 222 | $tableName, |
223 | 223 | array( 'value', 'exptime' ), |
— | — | @@ -225,14 +225,14 @@ |
226 | 226 | array( 'FOR UPDATE' ) ); |
227 | 227 | if ( $row === false ) { |
228 | 228 | // Missing |
229 | | - $db->commit(); |
| 229 | + $db->commit( __METHOD__ ); |
230 | 230 | |
231 | 231 | return null; |
232 | 232 | } |
233 | 233 | $db->delete( $tableName, array( 'keyname' => $key ), __METHOD__ ); |
234 | 234 | if ( $this->isExpired( $row->exptime ) ) { |
235 | 235 | // Expired, do not reinsert |
236 | | - $db->commit(); |
| 236 | + $db->commit( __METHOD__ ); |
237 | 237 | |
238 | 238 | return null; |
239 | 239 | } |
— | — | @@ -250,7 +250,7 @@ |
251 | 251 | // Race condition. See bug 28611 |
252 | 252 | $newValue = null; |
253 | 253 | } |
254 | | - $db->commit(); |
| 254 | + $db->commit( __METHOD__ ); |
255 | 255 | } catch ( DBQueryError $e ) { |
256 | 256 | $this->handleWriteError( $e ); |
257 | 257 | |
— | — | @@ -346,7 +346,7 @@ |
347 | 347 | $maxExpTime = $row->exptime; |
348 | 348 | } |
349 | 349 | |
350 | | - $db->begin(); |
| 350 | + $db->begin( __METHOD__ ); |
351 | 351 | $db->delete( |
352 | 352 | $this->getTableByShard( $i ), |
353 | 353 | array( |
— | — | @@ -355,7 +355,7 @@ |
356 | 356 | 'keyname' => $keys |
357 | 357 | ), |
358 | 358 | __METHOD__ ); |
359 | | - $db->commit(); |
| 359 | + $db->commit( __METHOD__ ); |
360 | 360 | |
361 | 361 | if ( $progressCallback ) { |
362 | 362 | if ( intval( $totalSeconds ) === 0 ) { |
— | — | @@ -384,9 +384,9 @@ |
385 | 385 | |
386 | 386 | try { |
387 | 387 | for ( $i = 0; $i < $this->shards; $i++ ) { |
388 | | - $db->begin(); |
| 388 | + $db->begin( __METHOD__ ); |
389 | 389 | $db->delete( $this->getTableByShard( $i ), '*', __METHOD__ ); |
390 | | - $db->commit(); |
| 390 | + $db->commit( __METHOD__ ); |
391 | 391 | } |
392 | 392 | } catch ( DBQueryError $e ) { |
393 | 393 | $this->handleWriteError( $e ); |
— | — | @@ -464,12 +464,12 @@ |
465 | 465 | } |
466 | 466 | |
467 | 467 | for ( $i = 0; $i < $this->shards; $i++ ) { |
468 | | - $db->begin(); |
| 468 | + $db->begin( __METHOD__ ); |
469 | 469 | $db->query( |
470 | 470 | 'CREATE TABLE ' . $db->tableName( $this->getTableByShard( $i ) ) . |
471 | 471 | ' LIKE ' . $db->tableName( 'objectcache' ), |
472 | 472 | __METHOD__ ); |
473 | | - $db->commit(); |
| 473 | + $db->commit( __METHOD__ ); |
474 | 474 | } |
475 | 475 | } |
476 | 476 | } |