"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "includes/db/DatabaseOracle.php" between
mediawiki-1.31.1.tar.gz and mediawiki-1.32.0.tar.gz

About: MediaWiki is a wiki engine (the collaborative editing software that runs for e.g. Wikipedia, the free encyclopedia).

DatabaseOracle.php  (mediawiki-1.31.1):DatabaseOracle.php  (mediawiki-1.32.0)
skipping to change at line 24 skipping to change at line 24
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html * http://www.gnu.org/copyleft/gpl.html
* *
* @file * @file
* @ingroup Database * @ingroup Database
*/ */
use MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\Database; use Wikimedia\Rdbms\Database;
use Wikimedia\Rdbms\DatabaseDomain;
use Wikimedia\Rdbms\Blob; use Wikimedia\Rdbms\Blob;
use Wikimedia\Rdbms\ResultWrapper; use Wikimedia\Rdbms\ResultWrapper;
use Wikimedia\Rdbms\DBConnectionError; use Wikimedia\Rdbms\DBConnectionError;
use Wikimedia\Rdbms\DBUnexpectedError; use Wikimedia\Rdbms\DBUnexpectedError;
use Wikimedia\Rdbms\DBExpectedError;
/** /**
* @ingroup Database * @ingroup Database
*/ */
class DatabaseOracle extends Database { class DatabaseOracle extends Database {
/** @var resource */ /** @var resource */
protected $mLastResult = null; protected $mLastResult = null;
/** @var int The number of rows affected as an integer */ /** @var int The number of rows affected as an integer */
protected $mAffectedRows; protected $mAffectedRows;
skipping to change at line 83 skipping to change at line 86
} }
function implicitGroupby() { function implicitGroupby() {
return false; return false;
} }
function implicitOrderby() { function implicitOrderby() {
return false; return false;
} }
/** protected function open( $server, $user, $password, $dbName, $schema, $ta
* Usually aborts on failure blePrefix ) {
* @param string $server
* @param string $user
* @param string $password
* @param string $dbName
* @throws DBConnectionError
* @return resource|null
*/
function open( $server, $user, $password, $dbName ) {
global $wgDBOracleDRCP; global $wgDBOracleDRCP;
if ( !function_exists( 'oci_connect' ) ) { if ( !function_exists( 'oci_connect' ) ) {
throw new DBConnectionError( throw new DBConnectionError(
$this, $this,
"Oracle functions missing, have you compiled PHP with the --with-oci8 option?\n " . "Oracle functions missing, have you compiled PHP with the --with-oci8 option?\n " .
"(Note: if you recently installed PHP, yo u may need to restart your webserver\n " . "(Note: if you recently installed PHP, yo u may need to restart your webserver\n " .
"and database)\n" ); "and database)\n" );
} }
$this->close(); $this->close();
$this->user = $user; $this->user = $user;
$this->password = $password; $this->password = $password;
// changed internal variables functions
// mServer now holds the TNS endpoint
// mDBname is schema name if different from username
if ( !$server ) { if ( !$server ) {
// backward compatibillity (server used to be null and TN S was supplied in dbname) // Backward compatibility (server used to be null and TNS was supplied in dbname)
$this->server = $dbName; $this->server = $dbName;
$this->dbName = $user; $realDatabase = $user;
} else { } else {
// $server now holds the TNS endpoint
$this->server = $server; $this->server = $server;
if ( !$dbName ) { // $dbName is schema name if different from username
$this->dbName = $user; $realDatabase = $dbName ?: $user;
} else {
$this->dbName = $dbName;
}
} }
if ( !strlen( $user ) ) { # e.g. the class is being loaded if ( !strlen( $user ) ) { # e.g. the class is being loaded
return null; return null;
} }
if ( $wgDBOracleDRCP ) { if ( $wgDBOracleDRCP ) {
$this->setFlag( DBO_PERSISTENT ); $this->setFlag( DBO_PERSISTENT );
} }
skipping to change at line 159 skipping to change at line 149
$this->conn = oci_connect( $this->conn = oci_connect(
$this->user, $this->user,
$this->password, $this->password,
$this->server, $this->server,
$this->defaultCharset, $this->defaultCharset,
$session_mode $session_mode
); );
} }
Wikimedia\restoreWarnings(); Wikimedia\restoreWarnings();
if ( $this->user != $this->dbName ) { if ( $this->user != $realDatabase ) {
// change current schema in session // change current schema in session
$this->selectDB( $this->dbName ); $this->selectDB( $realDatabase );
} else {
$this->currentDomain = new DatabaseDomain(
$realDatabase,
null,
$tablePrefix
);
} }
if ( !$this->conn ) { if ( !$this->conn ) {
throw new DBConnectionError( $this, $this->lastError() ); throw new DBConnectionError( $this, $this->lastError() );
} }
$this->opened = true; $this->opened = true;
# removed putenv calls because they interfere with the system glo baly # removed putenv calls because they interfere with the system glo baly
$this->doQuery( 'ALTER SESSION SET NLS_TIMESTAMP_FORMAT=\'DD-MM-Y YYY HH24:MI:SS.FF6\'' ); $this->doQuery( 'ALTER SESSION SET NLS_TIMESTAMP_FORMAT=\'DD-MM-Y YYY HH24:MI:SS.FF6\'' );
$this->doQuery( 'ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT=\'DD-M M-YYYY HH24:MI:SS.FF6\'' ); $this->doQuery( 'ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT=\'DD-M M-YYYY HH24:MI:SS.FF6\'' );
$this->doQuery( 'ALTER SESSION SET NLS_NUMERIC_CHARACTERS=\'.,\'' ); $this->doQuery( 'ALTER SESSION SET NLS_NUMERIC_CHARACTERS=\'.,\'' );
return $this->conn; return (bool)$this->conn;
} }
/** /**
* Closes a database connection, if it is open * Closes a database connection, if it is open
* Returns success, true if already closed * Returns success, true if already closed
* @return bool * @return bool
*/ */
protected function closeConnection() { protected function closeConnection() {
return oci_close( $this->conn ); return oci_close( $this->conn );
} }
skipping to change at line 449 skipping to change at line 445
} }
/** /**
* @param string $table * @param string $table
* @param array $row * @param array $row
* @param string $fname * @param string $fname
* @return bool * @return bool
* @throws DBUnexpectedError * @throws DBUnexpectedError
*/ */
private function insertOneRow( $table, $row, $fname ) { private function insertOneRow( $table, $row, $fname ) {
global $wgContLang;
$table = $this->tableName( $table ); $table = $this->tableName( $table );
// "INSERT INTO tables (a, b, c)" // "INSERT INTO tables (a, b, c)"
$sql = "INSERT INTO " . $table . " (" . implode( ',', array_keys( $row ) ) . ')'; $sql = "INSERT INTO " . $table . " (" . implode( ',', array_keys( $row ) ) . ')';
$sql .= " VALUES ("; $sql .= " VALUES (";
// for each value, append ":key" // for each value, append ":key"
$first = true; $first = true;
foreach ( $row as $col => &$val ) { foreach ( $row as $col => &$val ) {
if ( !$first ) { if ( !$first ) {
$sql .= ', '; $sql .= ', ';
skipping to change at line 496 skipping to change at line 490
} elseif ( $col_type != 'BLOB' && $col_type != 'CLOB' ) { } elseif ( $col_type != 'BLOB' && $col_type != 'CLOB' ) {
if ( is_object( $val ) ) { if ( is_object( $val ) ) {
$val = $val->fetch(); $val = $val->fetch();
} }
// backward compatibility // backward compatibility
if ( preg_match( '/^timestamp.*/i', $col_type ) = = 1 && strtolower( $val ) == 'infinity' ) { if ( preg_match( '/^timestamp.*/i', $col_type ) = = 1 && strtolower( $val ) == 'infinity' ) {
$val = $this->getInfinity(); $val = $this->getInfinity();
} }
$val = ( $wgContLang != null ) ? $wgContLang->che $val = MediaWikiServices::getInstance()->getConte
ckTitleEncoding( $val ) : $val; ntLanguage()->
checkTitleEncoding( $val );
if ( oci_bind_by_name( $stmt, ":$col", $val, -1, SQLT_CHR ) === false ) { if ( oci_bind_by_name( $stmt, ":$col", $val, -1, SQLT_CHR ) === false ) {
$e = oci_error( $stmt ); $e = oci_error( $stmt );
$this->reportQueryError( $e['message'], $ e['code'], $sql, __METHOD__ ); $this->reportQueryError( $e['message'], $ e['code'], $sql, __METHOD__ );
return false; return false;
} }
} else { } else {
/** @var OCI_Lob[] $lob */ /** @var OCI_Lob[] $lob */
$lob[$col] = oci_new_descriptor( $this->conn, OCI _D_LOB ); $lob[$col] = oci_new_descriptor( $this->conn, OCI _D_LOB );
if ( $lob[$col] === false ) { if ( $lob[$col] === false ) {
skipping to change at line 666 skipping to change at line 661
lower(atc.table_name), lower(atc.table_name),
lower(atc.column_name) lower(atc.column_name)
FROM all_sequences asq, all_tab_columns atc FROM all_sequences asq, all_tab_columns atc
WHERE decode( WHERE decode(
atc.table_name, atc.table_name,
'{$this->tablePrefix}MWUSER', '{$this->tablePrefix}MWUSER',
'{$this->tablePrefix}USER', '{$this->tablePrefix}USER',
atc.table_name atc.table_name
) || '_' || ) || '_' ||
atc.column_name || '_SEQ' = '{$this->tablePrefix} ' || asq.sequence_name atc.column_name || '_SEQ' = '{$this->tablePrefix} ' || asq.sequence_name
AND asq.sequence_owner = upper('{$this->dbName}') AND asq.sequence_owner = upper('{$this->getDBname
AND atc.owner = upper('{$this->dbName}')" ); ()}')
AND atc.owner = upper('{$this->getDBname()}')" );
while ( ( $row = $result->fetchRow() ) !== false ) { while ( ( $row = $result->fetchRow() ) !== false ) {
$this->sequenceData[$row[1]] = [ $this->sequenceData[$row[1]] = [
'sequence' => $row[0], 'sequence' => $row[0],
'column' => $row[2] 'column' => $row[2]
]; ];
} }
} }
$table = strtolower( $this->removeIdentifierQuotes( $this->tableN ame( $table ) ) ); $table = strtolower( $this->removeIdentifierQuotes( $this->tableN ame( $table ) ) );
return ( isset( $this->sequenceData[$table] ) ) ? $this->sequence Data[$table] : false; return $this->sequenceData[$table] ?? false;
} }
/** /**
* Returns the size of a text field, or -1 for "unlimited" * Returns the size of a text field, or -1 for "unlimited"
* *
* @param string $table * @param string $table
* @param string $field * @param string $field
* @return mixed * @return mixed
*/ */
function textFieldSize( $table, $field ) { function textFieldSize( $table, $field ) {
skipping to change at line 747 skipping to change at line 742
return $this->doQuery( "BEGIN DUPLICATE_TABLE( '$tabName', " . return $this->doQuery( "BEGIN DUPLICATE_TABLE( '$tabName', " .
"'$oldPrefix', '$newPrefix', $temporary ); END;" ); "'$oldPrefix', '$newPrefix', $temporary ); END;" );
} }
function listTables( $prefix = null, $fname = __METHOD__ ) { function listTables( $prefix = null, $fname = __METHOD__ ) {
$listWhere = ''; $listWhere = '';
if ( !empty( $prefix ) ) { if ( !empty( $prefix ) ) {
$listWhere = ' AND table_name LIKE \'' . strtoupper( $pre fix ) . '%\''; $listWhere = ' AND table_name LIKE \'' . strtoupper( $pre fix ) . '%\'';
} }
$owner = strtoupper( $this->dbName ); $owner = strtoupper( $this->getDBname() );
$result = $this->doQuery( "SELECT table_name FROM all_tables " . $result = $this->doQuery( "SELECT table_name FROM all_tables " .
"WHERE owner='$owner' AND table_name NOT LIKE '%!_IDX\$_' ESCAPE '!' $listWhere" ); "WHERE owner='$owner' AND table_name NOT LIKE '%!_IDX\$_' ESCAPE '!' $listWhere" );
// dirty code ... i know // dirty code ... i know
$endArray = []; $endArray = [];
$endArray[] = strtoupper( $prefix . 'MWUSER' ); $endArray[] = strtoupper( $prefix . 'MWUSER' );
$endArray[] = strtoupper( $prefix . 'PAGE' ); $endArray[] = strtoupper( $prefix . 'PAGE' );
$endArray[] = strtoupper( $prefix . 'IMAGE' ); $endArray[] = strtoupper( $prefix . 'IMAGE' );
$fixedOrderTabs = $endArray; $fixedOrderTabs = $endArray;
while ( ( $row = $result->fetchRow() ) !== false ) { while ( ( $row = $result->fetchRow() ) !== false ) {
skipping to change at line 825 skipping to change at line 820
* Query whether a given index exists * Query whether a given index exists
* @param string $table * @param string $table
* @param string $index * @param string $index
* @param string $fname * @param string $fname
* @return bool * @return bool
*/ */
function indexExists( $table, $index, $fname = __METHOD__ ) { function indexExists( $table, $index, $fname = __METHOD__ ) {
$table = $this->tableName( $table ); $table = $this->tableName( $table );
$table = strtoupper( $this->removeIdentifierQuotes( $table ) ); $table = strtoupper( $this->removeIdentifierQuotes( $table ) );
$index = strtoupper( $index ); $index = strtoupper( $index );
$owner = strtoupper( $this->dbName ); $owner = strtoupper( $this->getDBname() );
$sql = "SELECT 1 FROM all_indexes WHERE owner='$owner' AND index_ name='{$table}_{$index}'"; $sql = "SELECT 1 FROM all_indexes WHERE owner='$owner' AND index_ name='{$table}_{$index}'";
$res = $this->doQuery( $sql ); $res = $this->doQuery( $sql );
if ( $res ) { if ( $res ) {
$count = $res->numRows(); $count = $res->numRows();
$res->free(); $res->free();
} else { } else {
$count = 0; $count = 0;
} }
return $count != 0; return $count != 0;
skipping to change at line 847 skipping to change at line 842
/** /**
* Query whether a given table exists (in the given schema, or the defaul t mw one if not given) * Query whether a given table exists (in the given schema, or the defaul t mw one if not given)
* @param string $table * @param string $table
* @param string $fname * @param string $fname
* @return bool * @return bool
*/ */
function tableExists( $table, $fname = __METHOD__ ) { function tableExists( $table, $fname = __METHOD__ ) {
$table = $this->tableName( $table ); $table = $this->tableName( $table );
$table = $this->addQuotes( strtoupper( $this->removeIdentifierQuo tes( $table ) ) ); $table = $this->addQuotes( strtoupper( $this->removeIdentifierQuo tes( $table ) ) );
$owner = $this->addQuotes( strtoupper( $this->dbName ) ); $owner = $this->addQuotes( strtoupper( $this->getDBname() ) );
$sql = "SELECT 1 FROM all_tables WHERE owner=$owner AND table_nam e=$table"; $sql = "SELECT 1 FROM all_tables WHERE owner=$owner AND table_nam e=$table";
$res = $this->doQuery( $sql ); $res = $this->doQuery( $sql );
if ( $res && $res->numRows() > 0 ) { if ( $res && $res->numRows() > 0 ) {
$exists = true; $exists = true;
} else { } else {
$exists = false; $exists = false;
} }
$res->free(); $res->free();
skipping to change at line 1043 skipping to change at line 1038
} }
$cmd = ''; $cmd = '';
$done = false; $done = false;
} }
} }
return true; return true;
} }
function selectDB( $db ) { protected function doSelectDomain( DatabaseDomain $domain ) {
$this->dbName = $db; if ( $domain->getSchema() !== null ) {
if ( $db == null || $db == $this->user ) { // We use the *database* aspect of $domain for schema, no
t the domain schema
throw new DBExpectedError( $this, __CLASS__ . ": domain s
chemas are not supported." );
}
$database = $domain->getDatabase();
if ( $database === null || $database === $this->user ) {
// Backward compatibility
$this->currentDomain = $domain;
return true; return true;
} }
$sql = 'ALTER SESSION SET CURRENT_SCHEMA=' . strtoupper( $db );
// https://docs.oracle.com/javadb/10.8.3.0/ref/rrefsqlj32268.html
$encDatabase = $this->addIdentifierQuotes( strtoupper( $database
) );
$sql = "ALTER SESSION SET CURRENT_SCHEMA=$encDatabase";
$stmt = oci_parse( $this->conn, $sql ); $stmt = oci_parse( $this->conn, $sql );
Wikimedia\suppressWarnings(); Wikimedia\suppressWarnings();
$success = oci_execute( $stmt ); $success = oci_execute( $stmt );
Wikimedia\restoreWarnings(); Wikimedia\restoreWarnings();
if ( !$success ) { if ( $success ) {
// Update that domain fields on success (no exception thr
own)
$this->currentDomain = $domain;
} else {
$e = oci_error( $stmt ); $e = oci_error( $stmt );
if ( $e['code'] != '1435' ) { $this->reportQueryError( $e['message'], $e['code'], $sql,
$this->reportQueryError( $e['message'], $e['code' __METHOD__ );
], $sql, __METHOD__ );
}
return false;
} }
return true; return true;
} }
function strencode( $s ) { function strencode( $s ) {
return str_replace( "'", "''", $s ); return str_replace( "'", "''", $s );
} }
function addQuotes( $s ) { function addQuotes( $s ) {
global $wgContLang; $contLang = MediaWikiServices::getInstance()->getContentLanguage(
if ( isset( $wgContLang->mLoaded ) && $wgContLang->mLoaded ) { );
$s = $wgContLang->checkTitleEncoding( $s ); if ( isset( $contLang->mLoaded ) && $contLang->mLoaded ) {
$s = $contLang->checkTitleEncoding( $s );
} }
return "'" . $this->strencode( $s ) . "'"; return "'" . $this->strencode( $s ) . "'";
} }
public function addIdentifierQuotes( $s ) { public function addIdentifierQuotes( $s ) {
if ( !$this->getFlag( DBO_DDLMODE ) ) { if ( !$this->getFlag( DBO_DDLMODE ) ) {
$s = '/*Q*/' . $s; $s = '/*Q*/' . $s;
} }
skipping to change at line 1095 skipping to change at line 1100
public function removeIdentifierQuotes( $s ) { public function removeIdentifierQuotes( $s ) {
return strpos( $s, '/*Q*/' ) === false ? $s : substr( $s, 5 ); return strpos( $s, '/*Q*/' ) === false ? $s : substr( $s, 5 );
} }
public function isQuotedIdentifier( $s ) { public function isQuotedIdentifier( $s ) {
return strpos( $s, '/*Q*/' ) !== false; return strpos( $s, '/*Q*/' ) !== false;
} }
private function wrapFieldForWhere( $table, &$col, &$val ) { private function wrapFieldForWhere( $table, &$col, &$val ) {
global $wgContLang;
$col_info = $this->fieldInfoMulti( $table, $col ); $col_info = $this->fieldInfoMulti( $table, $col );
$col_type = $col_info != false ? $col_info->type() : 'CONSTANT'; $col_type = $col_info != false ? $col_info->type() : 'CONSTANT';
if ( $col_type == 'CLOB' ) { if ( $col_type == 'CLOB' ) {
$col = 'TO_CHAR(' . $col . ')'; $col = 'TO_CHAR(' . $col . ')';
$val = $wgContLang->checkTitleEncoding( $val ); $val =
MediaWikiServices::getInstance()->getContentLangu
age()->checkTitleEncoding( $val );
} elseif ( $col_type == 'VARCHAR2' ) { } elseif ( $col_type == 'VARCHAR2' ) {
$val = $wgContLang->checkTitleEncoding( $val ); $val =
MediaWikiServices::getInstance()->getContentLangu
age()->checkTitleEncoding( $val );
} }
} }
private function wrapConditionsForWhere( $table, $conds, $parentCol = nul l ) { private function wrapConditionsForWhere( $table, $conds, $parentCol = nul l ) {
$conds2 = []; $conds2 = [];
foreach ( $conds as $col => $val ) { foreach ( $conds as $col => $val ) {
if ( is_array( $val ) ) { if ( is_array( $val ) ) {
$conds2[$col] = $this->wrapConditionsForWhere( $t able, $val, $col ); $conds2[$col] = $this->wrapConditionsForWhere( $t able, $val, $col );
} else { } else {
if ( is_numeric( $col ) && $parentCol != null ) { if ( is_numeric( $col ) && $parentCol != null ) {
skipping to change at line 1191 skipping to change at line 1196
public function delete( $table, $conds, $fname = __METHOD__ ) { public function delete( $table, $conds, $fname = __METHOD__ ) {
global $wgActorTableSchemaMigrationStage; global $wgActorTableSchemaMigrationStage;
if ( is_array( $conds ) ) { if ( is_array( $conds ) ) {
$conds = $this->wrapConditionsForWhere( $table, $conds ); $conds = $this->wrapConditionsForWhere( $table, $conds );
} }
// a hack for deleting pages, users and images (which have non-nu llable FKs) // a hack for deleting pages, users and images (which have non-nu llable FKs)
// all deletions on these tables have transactions so final failu re rollbacks these updates // all deletions on these tables have transactions so final failu re rollbacks these updates
// @todo: Normalize the schema to match MySQL, no special FKs and such // @todo: Normalize the schema to match MySQL, no special FKs and such
$table = $this->tableName( $table ); $table = $this->tableName( $table );
if ( $table == $this->tableName( 'user' ) && $wgActorTableSchemaM if ( $table == $this->tableName( 'user' ) &&
igrationStage < MIGRATION_NEW ) { ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_WRITE
_OLD )
) {
$this->update( 'archive', [ 'ar_user' => 0 ], $this->update( 'archive', [ 'ar_user' => 0 ],
[ 'ar_user' => $conds['user_id'] ], $fname ); [ 'ar_user' => $conds['user_id'] ], $fname );
$this->update( 'ipblocks', [ 'ipb_user' => 0 ], $this->update( 'ipblocks', [ 'ipb_user' => 0 ],
[ 'ipb_user' => $conds['user_id'] ], $fname ); [ 'ipb_user' => $conds['user_id'] ], $fname );
$this->update( 'image', [ 'img_user' => 0 ], $this->update( 'image', [ 'img_user' => 0 ],
[ 'img_user' => $conds['user_id'] ], $fname ); [ 'img_user' => $conds['user_id'] ], $fname );
$this->update( 'oldimage', [ 'oi_user' => 0 ], $this->update( 'oldimage', [ 'oi_user' => 0 ],
[ 'oi_user' => $conds['user_id'] ], $fname ); [ 'oi_user' => $conds['user_id'] ], $fname );
$this->update( 'filearchive', [ 'fa_deleted_user' => 0 ], $this->update( 'filearchive', [ 'fa_deleted_user' => 0 ],
[ 'fa_deleted_user' => $conds['user_id'] ], $fnam e ); [ 'fa_deleted_user' => $conds['user_id'] ], $fnam e );
skipping to change at line 1228 skipping to change at line 1235
/** /**
* @param string $table * @param string $table
* @param array $values * @param array $values
* @param array $conds * @param array $conds
* @param string $fname * @param string $fname
* @param array $options * @param array $options
* @return bool * @return bool
* @throws DBUnexpectedError * @throws DBUnexpectedError
*/ */
function update( $table, $values, $conds, $fname = __METHOD__, $options = [] ) { function update( $table, $values, $conds, $fname = __METHOD__, $options = [] ) {
global $wgContLang;
$table = $this->tableName( $table ); $table = $this->tableName( $table );
$opts = $this->makeUpdateOptions( $options ); $opts = $this->makeUpdateOptions( $options );
$sql = "UPDATE $opts $table SET "; $sql = "UPDATE $opts $table SET ";
$first = true; $first = true;
foreach ( $values as $col => &$val ) { foreach ( $values as $col => &$val ) {
$sqlSet = $this->fieldBindStatement( $table, $col, $val, true ); $sqlSet = $this->fieldBindStatement( $table, $col, $val, true );
if ( !$first ) { if ( !$first ) {
$sqlSet = ', ' . $sqlSet; $sqlSet = ', ' . $sqlSet;
skipping to change at line 1273 skipping to change at line 1278
// do nothing ... null was inserted in statement creation // do nothing ... null was inserted in statement creation
} elseif ( $col_type != 'BLOB' && $col_type != 'CLOB' ) { } elseif ( $col_type != 'BLOB' && $col_type != 'CLOB' ) {
if ( is_object( $val ) ) { if ( is_object( $val ) ) {
$val = $val->getData(); $val = $val->getData();
} }
if ( preg_match( '/^timestamp.*/i', $col_type ) = = 1 && strtolower( $val ) == 'infinity' ) { if ( preg_match( '/^timestamp.*/i', $col_type ) = = 1 && strtolower( $val ) == 'infinity' ) {
$val = '31-12-2030 12:00:00.000000'; $val = '31-12-2030 12:00:00.000000';
} }
$val = ( $wgContLang != null ) ? $wgContLang->che $val = MediaWikiServices::getInstance()->getConte
ckTitleEncoding( $val ) : $val; ntLanguage()->
checkTitleEncoding( $val );
if ( oci_bind_by_name( $stmt, ":$col", $val ) === false ) { if ( oci_bind_by_name( $stmt, ":$col", $val ) === false ) {
$e = oci_error( $stmt ); $e = oci_error( $stmt );
$this->reportQueryError( $e['message'], $ e['code'], $sql, __METHOD__ ); $this->reportQueryError( $e['message'], $ e['code'], $sql, __METHOD__ );
return false; return false;
} }
} else { } else {
/** @var OCI_Lob[] $lob */ /** @var OCI_Lob[] $lob */
$lob[$col] = oci_new_descriptor( $this->conn, OCI _D_LOB ); $lob[$col] = oci_new_descriptor( $this->conn, OCI _D_LOB );
if ( $lob[$col] === false ) { if ( $lob[$col] === false ) {
skipping to change at line 1345 skipping to change at line 1351
} }
function bitAnd( $fieldLeft, $fieldRight ) { function bitAnd( $fieldLeft, $fieldRight ) {
return 'BITAND(' . $fieldLeft . ', ' . $fieldRight . ')'; return 'BITAND(' . $fieldLeft . ', ' . $fieldRight . ')';
} }
function bitOr( $fieldLeft, $fieldRight ) { function bitOr( $fieldLeft, $fieldRight ) {
return 'BITOR(' . $fieldLeft . ', ' . $fieldRight . ')'; return 'BITOR(' . $fieldLeft . ', ' . $fieldRight . ')';
} }
function getDBname() {
return $this->dbName;
}
function getServer() { function getServer() {
return $this->server; return $this->server;
} }
public function buildGroupConcatField( public function buildGroupConcatField(
$delim, $table, $field, $conds = '', $join_conds = [] $delim, $table, $field, $conds = '', $join_conds = []
) { ) {
$fld = "LISTAGG($field," . $this->addQuotes( $delim ) . ") WITHIN GROUP (ORDER BY $field)"; $fld = "LISTAGG($field," . $this->addQuotes( $delim ) . ") WITHIN GROUP (ORDER BY $field)";
return '(' . $this->selectSQLText( $table, $fld, $conds, null, [] , $join_conds ) . ')'; return '(' . $this->selectSQLText( $table, $fld, $conds, null, [] , $join_conds ) . ')';
 End of changes. 32 change blocks. 
61 lines changed or deleted 72 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)