return $this->trxLevel ? OCI_NO_AUTO_COMMIT : OCI_COMMIT_ON_SUCCESS;
}
+ /**
+ * @param string $sql
+ * @return bool|mixed|ORAResult
+ */
protected function doQuery( $sql ) {
wfDebug( "SQL: [$sql]\n" );
if ( !StringUtils::isUtf8( $sql ) ) {
public function upsert( $table, array $rows, array $uniqueIndexes, array $set,
$fname = __METHOD__
) {
- if ( !count( $rows ) ) {
+ if ( $rows === [] ) {
return true; // nothing to do
}
if ( $sl < 0 ) {
continue;
}
- if ( '-' == $line[0] && '-' == $line[1] ) {
+ if ( $line[0] == '-' && $line[1] == '-' ) {
continue;
}
$dollarquote = true;
}
} elseif ( !$dollarquote ) {
- if ( ';' == $line[$sl] && ( $sl < 2 || ';' != $line[$sl - 1] ) ) {
+ if ( $line[$sl] == ';' && ( $sl < 2 || $line[$sl - 1] != ';' ) ) {
$done = true;
$line = substr( $line, 0, $sl );
}
call_user_func( $resultCallback, $res, $this );
}
- if ( false === $res ) {
+ if ( $res === false ) {
$err = $this->lastError();
return "Query \"{$cmd}\" failed with error code \"$err\".\n";