From: Ian Baker Date: Wed, 11 Jan 2012 02:02:26 +0000 (+0000) Subject: sqlite needs its timestamps quoted X-Git-Tag: 1.31.0-rc.0~25355 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=9dabae1e2f77a885477aef9ae19629ccab42fbb8;p=lhc%2Fweb%2Fwiklou.git sqlite needs its timestamps quoted fixed some memcache timestamp bugs followup to r108559 --- diff --git a/includes/ConcurrencyCheck.php b/includes/ConcurrencyCheck.php index c207eff684..f4391294ae 100644 --- a/includes/ConcurrencyCheck.php +++ b/includes/ConcurrencyCheck.php @@ -103,7 +103,7 @@ class ConcurrencyCheck { array( 'cc_resource_type' => $this->resourceType, 'cc_record' => $record, - '(cc_user = ' . $userId . ' OR cc_expiration <= ' . wfTimestamp( TS_MW ) . ')', // only the owner can perform a checkin + '(cc_user = ' . $userId . ' OR cc_expiration <= ' . $dbw->addQuotes(wfTimestamp( TS_MW )) . ')', // only the owner can perform a checkin ), __METHOD__, array() @@ -126,7 +126,7 @@ class ConcurrencyCheck { // this was a cache miss. populate the cache with data from the db. // cache is set to expire at the same time as the checkout, since it'll become invalid then anyway. // inside this transaction, a row-level lock is established which ensures cache concurrency - $wgMemc->set( $cacheKey, array( 'userId' => $row->cc_user, 'expiration' => $row->cc_expiration ), wfTimestamp( TS_UNIX, $row->cc_expiration ) - time() ); + $wgMemc->set( $cacheKey, array( 'userId' => $row->cc_user, 'expiration' => wfTimestamp( TS_UNIX, $row->cc_expiration ) ), wfTimestamp( TS_UNIX, $row->cc_expiration ) - time() ); $dbw->rollback(); return false; } @@ -286,8 +286,8 @@ class ConcurrencyCheck { // safe to store values since this is inside the transaction $wgMemc->set( wfMemcKey( 'concurrencycheck', $this->resourceType, $record['cc_record'] ), - array( 'userId' => $record['cc_user'], 'expiration' => $record['cc_expiration'] ), - $record['cc_expiration'] - time() + array( 'userId' => $record['cc_user'], 'expiration' => wfTimestamp( TS_UNIX, $record['cc_expiration'] ) ), + wfTimestamp( TS_UNIX, $record['cc_expiration'] ) - time() ); } }