* (bug 5570) Problems using <special page>/parameter link form for long titles
* (bug 3884) Add $user parameter to AddNewUser hook, call it for by-email
registrations as well as self-registrations.
+* (bug 4327) Report age of cached data sets in query pages
== Compatibility ==
$dbw->ignoreErrors( $ignoreW );
$dbr->ignoreErrors( $ignoreR );
}
+
+ # Update the querycache_info record for the page
+ $dbw->delete( 'querycache_info', array( 'qci_type' => $this->getName() ), $fname );
+ $dbw->insert( 'querycache_info', array( 'qci_type' => $this->getName(), 'qci_timestamp' => $dbw->timestamp() ), $fname );
+
}
return $num;
}
* @param $shownavigation show navigation like "next 200"?
*/
function doQuery( $offset, $limit, $shownavigation=true ) {
- global $wgUser, $wgOut, $wgContLang;
+ global $wgUser, $wgOut, $wgLang, $wgContLang;
$sname = $this->getName();
$fname = get_class($this) . '::doQuery';
$sql =
"SELECT qc_type as type, qc_namespace as namespace,qc_title as title, qc_value as value
FROM $querycache WHERE qc_type='$type'";
+
+ # Fetch the timestamp of this update
+ $tRes = $dbr->select( 'querycache_info', array( 'qci_timestamp' ), array( 'qci_type' => $type ), $fname );
+ $tRow = $dbr->fetchObject( $tRes );
+ $updated = $tRow->qci_timestamp;
+ $updatedTs = $wgLang->timeAndDate( $updated, true, true );
+
if ( ! $this->listoutput )
- $wgOut->addWikiText( wfMsg( 'perfcached' ) );
+ $wgOut->addWikiText( wfMsg( 'perfcached', $updatedTs ) );
+
}
$sql .= $this->getOrder();
--- /dev/null
+CREATE TABLE /*$wgDBprefix*/querycache_info (\r
+\r
+ -- Special page name\r
+ -- Corresponds to a qc_type value\r
+ qci_type varchar(255) NOT NULL default '',\r
+\r
+ -- Timestamp of last update\r
+ qci_timestamp char(14) NOT NULL default '19700101000000',\r
+\r
+ UNIQUE KEY ( qci_type )\r
+\r
+) TYPE=InnoDB;
\ No newline at end of file
PRIMARY KEY job_id (job_id),
KEY (job_cmd, job_namespace, job_title)
) TYPE=InnoDB, DEFAULT CHARSET=utf8;
+
+-- Details of updates to cached special pages
+CREATE TABLE /*$wgDBprefix*/querycache_info (
+
+ -- Special page name
+ -- Corresponds to a qc_type value
+ qci_type varchar(255) NOT NULL default '',
+
+ -- Timestamp of last update
+ qci_timestamp char(14) NOT NULL default '19700101000000',
+
+ UNIQUE KEY ( qci_type )
+
+) TYPE=InnoDB;
\ No newline at end of file
PRIMARY KEY job_id (job_id),
KEY (job_cmd, job_namespace, job_title)
) TYPE=InnoDB;
+
+
+-- Details of updates to cached special pages
+CREATE TABLE /*$wgDBprefix*/querycache_info (
+
+ -- Special page name
+ -- Corresponds to a qc_type value
+ qci_type varchar(255) NOT NULL default '',
+
+ -- Timestamp of last update
+ qci_timestamp char(14) NOT NULL default '19700101000000',
+
+ UNIQUE KEY ( qci_type )
+
+) TYPE=InnoDB;
\ No newline at end of file
array( 'externallinks', 'patch-externallinks.sql' ),
array( 'job', 'patch-job.sql' ),
array( 'langlinks', 'patch-langlinks.sql' ),
+ array( 'querycache_info', 'patch-querycacheinfo.sql' ),
);
$wgNewFields = array(