dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RevisionStore: Properly encode timestamp
[lhc/web/wiklou.git]
/
includes
/
Storage
/
RevisionStore.php
diff --git
a/includes/Storage/RevisionStore.php
b/includes/Storage/RevisionStore.php
index
e00deef
..
2e3103c
100644
(file)
--- a/
includes/Storage/RevisionStore.php
+++ b/
includes/Storage/RevisionStore.php
@@
-455,7
+455,7
@@
class RevisionStore
$dbw->insert( 'ip_changes', $ipcRow, __METHOD__ );
}
$dbw->insert( 'ip_changes', $ipcRow, __METHOD__ );
}
- $newSlot = SlotRecord::newSaved( $row['rev_id'], $blobAddress, $slot );
+ $newSlot = SlotRecord::newSaved( $row['rev_id'], $
textId, $
blobAddress, $slot );
$slots = new RevisionSlots( [ 'main' => $newSlot ] );
$rev = new RevisionStoreRecord(
$slots = new RevisionSlots( [ 'main' => $newSlot ] );
$rev = new RevisionStoreRecord(
@@
-751,6
+751,10
@@
class RevisionStore
private function emulateMainSlot_1_29( $row, $queryFlags, Title $title ) {
$mainSlotRow = new stdClass();
$mainSlotRow->role_name = 'main';
private function emulateMainSlot_1_29( $row, $queryFlags, Title $title ) {
$mainSlotRow = new stdClass();
$mainSlotRow->role_name = 'main';
+ $mainSlotRow->model_name = null;
+ $mainSlotRow->slot_revision_id = null;
+ $mainSlotRow->content_address = null;
+ $mainSlotRow->slot_content_id = null;
$content = null;
$blobData = null;
$content = null;
$blobData = null;
@@
-763,7
+767,8
@@
class RevisionStore
}
if ( isset( $row->rev_text_id ) && $row->rev_text_id > 0 ) {
}
if ( isset( $row->rev_text_id ) && $row->rev_text_id > 0 ) {
- $mainSlotRow->cont_address = 'tt:' . $row->rev_text_id;
+ $mainSlotRow->slot_content_id = $row->rev_text_id;
+ $mainSlotRow->content_address = 'tt:' . $row->rev_text_id;
}
if ( isset( $row->old_text ) ) {
}
if ( isset( $row->old_text ) ) {
@@
-776,10
+781,10
@@
class RevisionStore
$blobFlags = ( $row->old_flags === null ) ? '' : $row->old_flags;
}
$blobFlags = ( $row->old_flags === null ) ? '' : $row->old_flags;
}
- $mainSlotRow->slot_revision = intval( $row->rev_id );
+ $mainSlotRow->slot_revision
_id
= intval( $row->rev_id );
- $mainSlotRow->cont_size = isset( $row->rev_len ) ? intval( $row->rev_len ) : null;
- $mainSlotRow->cont_sha1 = isset( $row->rev_sha1 ) ? strval( $row->rev_sha1 ) : null;
+ $mainSlotRow->cont
ent
_size = isset( $row->rev_len ) ? intval( $row->rev_len ) : null;
+ $mainSlotRow->cont
ent
_sha1 = isset( $row->rev_sha1 ) ? strval( $row->rev_sha1 ) : null;
$mainSlotRow->model_name = isset( $row->rev_content_model )
? strval( $row->rev_content_model )
: null;
$mainSlotRow->model_name = isset( $row->rev_content_model )
? strval( $row->rev_content_model )
: null;
@@
-788,13
+793,16
@@
class RevisionStore
? strval( $row->rev_content_format )
: null;
} elseif ( is_array( $row ) ) {
? strval( $row->rev_content_format )
: null;
} elseif ( is_array( $row ) ) {
- $mainSlotRow->slot_revision = isset( $row['id'] ) ? intval( $row['id'] ) : null;
+ $mainSlotRow->slot_revision
_id
= isset( $row['id'] ) ? intval( $row['id'] ) : null;
- $mainSlotRow->cont_address = isset( $row['text_id'] )
+ $mainSlotRow->slot_content_id = isset( $row['text_id'] )
+ ? intval( $row['text_id'] )
+ : null;
+ $mainSlotRow->content_address = isset( $row['text_id'] )
? 'tt:' . intval( $row['text_id'] )
: null;
? 'tt:' . intval( $row['text_id'] )
: null;
- $mainSlotRow->cont_size = isset( $row['len'] ) ? intval( $row['len'] ) : null;
- $mainSlotRow->cont_sha1 = isset( $row['sha1'] ) ? strval( $row['sha1'] ) : null;
+ $mainSlotRow->cont
ent
_size = isset( $row['len'] ) ? intval( $row['len'] ) : null;
+ $mainSlotRow->cont
ent
_sha1 = isset( $row['sha1'] ) ? strval( $row['sha1'] ) : null;
$mainSlotRow->model_name = isset( $row['content_model'] )
? strval( $row['content_model'] ) : null; // XXX: must be a string!
$mainSlotRow->model_name = isset( $row['content_model'] )
? strval( $row['content_model'] ) : null; // XXX: must be a string!
@@
-853,6
+861,7
@@
class RevisionStore
};
}
};
}
+ $mainSlotRow->slot_id = $mainSlotRow->slot_revision_id;
return new SlotRecord( $mainSlotRow, $content );
}
return new SlotRecord( $mainSlotRow, $content );
}
@@
-1035,9
+1044,10
@@
class RevisionStore
* @return RevisionRecord|null
*/
public function getRevisionByTimestamp( $title, $timestamp ) {
* @return RevisionRecord|null
*/
public function getRevisionByTimestamp( $title, $timestamp ) {
+ $db = $this->getDBConnection( DB_REPLICA );
return $this->newRevisionFromConds(
[
return $this->newRevisionFromConds(
[
- 'rev_timestamp' => $
timestamp
,
+ 'rev_timestamp' => $
db->timestamp( $timestamp )
,
'page_namespace' => $title->getNamespace(),
'page_title' => $title->getDBkey()
],
'page_namespace' => $title->getNamespace(),
'page_title' => $title->getDBkey()
],