Change-Id: I51a541fb560438a34522ca442a8b8e572830deea
$options['LIMIT'] = 1;
$res = $this->select( $table, $var, $cond, $fname, $options, $join_conds );
$options['LIMIT'] = 1;
$res = $this->select( $table, $var, $cond, $fname, $options, $join_conds );
- if ( $res === false || !$this->numRows( $res ) ) {
- return false;
+ if ( $res === false ) {
+ throw new DBUnexpectedError( $this, "Got false from select()" );
}
$row = $this->fetchRow( $res );
}
$row = $this->fetchRow( $res );
-
- if ( $row !== false ) {
- return reset( $row );
- } else {
+ if ( $row === false ) {
+
+ return reset( $row );
}
public function selectFieldValues(
}
public function selectFieldValues(
$res = $this->select( $table, [ 'value' => $var ], $cond, $fname, $options, $join_conds );
if ( $res === false ) {
$res = $this->select( $table, [ 'value' => $var ], $cond, $fname, $options, $join_conds );
if ( $res === false ) {
+ throw new DBUnexpectedError( $this, "Got false from select()" );
) {
$options = (array)$options;
$options['LIMIT'] = 1;
) {
$options = (array)$options;
$options['LIMIT'] = 1;
- $res = $this->select( $table, $vars, $conds, $fname, $options, $join_conds );
+ $res = $this->select( $table, $vars, $conds, $fname, $options, $join_conds );
+ throw new DBUnexpectedError( $this, "Got false from select()" );
}
if ( !$this->numRows( $res ) ) {
return false;
}
}
if ( !$this->numRows( $res ) ) {
return false;
}
- $obj = $this->fetchObject( $res );
-
- return $obj;
+ return $this->fetchObject( $res );
}
public function estimateRowCount(
}
public function estimateRowCount(