Database::select() can return false, so we should check for it before
attempting to iterate on the result or to call methods on it.
Change-Id: I0862493305e5b2784422e0e94b3e62e734267795
// We do not want to flush the TRX as that can break callers.
$db->trxLevel() ? array( 'LOCK IN SHARE MODE' ) : array()
);
+ if ( $res === false ) {
+ continue;
+ }
foreach ( $res as $row ) {
$row->serverIndex = $serverIndex;
$row->tableName = $tableName;
$conds,
__METHOD__,
array( 'LIMIT' => 100, 'ORDER BY' => 'exptime' ) );
- if ( !$rows->numRows() ) {
+ if ( $rows === false || !$rows->numRows() ) {
break;
}
$keys = array();