$safeseq = str_replace( "'", "''", $seqName );
$res = $this->query( "SELECT nextval('$safeseq')" );
$row = $this->fetchRow( $res );
- $this->mInsertId = $row[0];
+ $this->mInsertId = is_null( $row[0] ) ? null : (int)$row[0];
return $this->mInsertId;
}
);
if ( $dbw->affectedRows() > 0 ) {
- $newid = $pageId ?: $dbw->insertId();
+ $newid = $pageId ? (int)$pageId : $dbw->insertId();
$this->mId = $newid;
$this->mTitle->resetArticleID( $newid );
* @ingroup Maintenance
*/
class BaseDump {
+ /** @var XMLReader */
protected $reader = null;
protected $atEnd = false;
protected $atPageEnd = false;
* @ingroup Maintenance
*/
class TextPassDumper extends BackupDumper {
+ /** @var BaseDump */
public $prefetch = null;
+ /** @var string|bool */
+ private $thisPage;
+ /** @var string|bool */
+ private $thisRev;
// when we spend more than maxTimeAllowed seconds on this run, we continue
// processing until we write out the next complete page, then save output file(s),
if ( $text === false && isset( $this->prefetch ) && $prefetchNotTried ) {
$prefetchNotTried = false;
$tryIsPrefetch = true;
- $text = $this->prefetch->prefetch( intval( $this->thisPage ),
- intval( $this->thisRev ) );
+ $text = $this->prefetch->prefetch( (int)$this->thisPage, (int)$this->thisRev );
if ( $text === null ) {
$text = false;
// increasing
$this->assertEquals(
[ $this->pageId2, $this->pageId3, $this->pageId4 ],
- [ $this->pageId1 + 1, $this->pageId2 + 1, $this->pageId3 + 1 ],
+ [ $this->pageId1 + 1, $this->pageId1 + 2, $this->pageId1 + 3 ],
"Page ids increasing without holes" );
}