Author: mediawiki-bugzilla
Description:
Hi, if I do the following I am receiving lots of results:
$t = Title::newFromText("Main_Page");
$dbr = wfGetDB(DB_SLAVE);
while ($row = $dbr->fetchObject(Revision::fetchRevision($t))) {
var_dump($row);
}
However, doing the following I am only receving a single result:
$t = Title::newFromText("Main_Page");
$r = Revision::fetchRevision($t);
$dbr = wfGetDB(DB_SLAVE);
while ($row = $dbr->fetchObject($r)) {
var_dump($row);
}
The same here:
$dbr = wfGetDB(DB_SLAVE);
$t = Title::newFromText("Main_Page");
$r = ResultWrapper ($dbr, Revision::fetchRevision($t));
while ($row = $dbr->fetchObject($r)) {
var_dump($row);
}
And to top it, if I change the code at top to the following, I receive the output "1", too:
$t = Title::newFromText("Main_Page");
print Revision::fetchRevision($t)->numRows();
Can somebody explain why it is this inconsistent? Is there something I'm doing wrong?
Version: 1.11.x
Severity: normal