MediaWiki REL1_28
DatabaseOracle Class Reference
Inheritance diagram for DatabaseOracle:
Collaboration diagram for DatabaseOracle:

Public Member Functions

 __construct (array $p)
 
 __destruct ()
 
 addIdentifierQuotes ( $s)
 
 addQuotes ( $s)
 
 affectedRows ()
 
 aggregateValue ( $valuedata, $valuename='value')
 Return aggregated value function call.
 
 bitAnd ( $fieldLeft, $fieldRight)
 
 bitNot ( $field)
 
 bitOr ( $fieldLeft, $fieldRight)
 
 buildGroupConcatField ( $delim, $table, $field, $conds='', $join_conds=[])
 
 buildStringCast ( $field)
 
 dataSeek ( $res, $row)
 
 decodeBlob ( $b)
 
 delete ( $table, $conds, $fname=__METHOD__)
 
 dropTable ( $tableName, $fName=__METHOD__)
 
 duplicateTableStructure ( $oldName, $newName, $temporary=false, $fname=__METHOD__)
 
 encodeBlob ( $b)
 
 execFlags ()
 
 fetchObject ( $res)
 
 fetchRow ( $res)
 
 fieldInfo ( $table, $field)
 
 fieldName ( $stmt, $n)
 
 freeResult ( $res)
 Frees resources associated with the LOB descriptor.
 
 getDBname ()
 
 getInfinity ()
 
 getServer ()
 
 getServerVersion ()
 
 getSoftwareLink ()
 
 getType ()
 
 implicitGroupby ()
 
 implicitOrderby ()
 
 indexExists ( $table, $index, $fname=__METHOD__)
 Query whether a given index exists.
 
 indexInfo ( $table, $index, $fname=__METHOD__)
 Returns information about an index If errors are explicitly ignored, returns NULL on failure.
 
 indexUnique ( $table, $index, $fname=__METHOD__)
 
 insert ( $table, $a, $fname=__METHOD__, $options=[])
 
 insertId ()
 This must be called after nextSequenceVal.
 
 isQuotedIdentifier ( $s)
 
 lastErrno ()
 
 lastError ()
 
 limitResult ( $sql, $limit, $offset=false)
 
 listTables ( $prefix=null, $fname=__METHOD__)
 
 makeSelectOptions ( $options)
 Returns an optional USE INDEX clause to go after the table, and a string to go at the end of the query.
 
 nativeInsertSelect ( $destTable, $srcTable, $varMap, $conds, $fname=__METHOD__, $insertOptions=[], $selectOptions=[])
 
 nextSequenceValue ( $seqName)
 Return the next in a sequence, save the value for retrieval via insertId()
 
 numFields ( $res)
 
 numRows ( $res)
 
 open ( $server, $user, $password, $dbName)
 Usually aborts on failure.
 
 queryIgnore ( $sql, $fname='')
 
 removeIdentifierQuotes ( $s)
 
 selectDB ( $db)
 
 selectRow ( $table, $vars, $conds, $fname=__METHOD__, $options=[], $join_conds=[])
 
 sourceStream ( $fp, $lineCallback=false, $resultCallback=false, $fname=__METHOD__, $inputCallback=false)
 defines must comply with ^define\s*([^\s=]*)\s*=\s?'\{\$([^\}]*)\}';
 
 strencode ( $s)
 
 tableExists ( $table, $fname=__METHOD__)
 Query whether a given table exists (in the given schema, or the default mw one if not given)
 
 tableName ( $name, $format='quoted')
 
 tableNameInternal ( $name)
 
 textFieldSize ( $table, $field)
 Returns the size of a text field, or -1 for "unlimited".
 
 timestamp ( $ts=0)
 
 unionQueries ( $sqls, $all)
 
 update ( $table, $values, $conds, $fname=__METHOD__, $options=[])
 
 upsert ( $table, array $rows, array $uniqueIndexes, array $set, $fname=__METHOD__)
 
 wasDeadlock ()
 

Protected Member Functions

 closeConnection ()
 Closes a database connection, if it is open Returns success, true if already closed.
 
 doBegin ( $fname=__METHOD__)
 
 doCommit ( $fname=__METHOD__)
 
 doQuery ( $sql)
 
 doRollback ( $fname=__METHOD__)
 

Protected Attributes

int $mAffectedRows
 The number of rows affected as an integer.
 
resource $mLastResult = null
 

Private Member Functions

 fieldBindStatement ( $table, $col, &$val, $includeCol=false)
 
 fieldInfoMulti ( $table, $field)
 Function translates mysql_fetch_field() functionality on ORACLE.
 
 getSequenceData ( $table)
 Return sequence_name if table has a sequence.
 
 insertOneRow ( $table, $row, $fname)
 
 wrapConditionsForWhere ( $table, $conds, $parentCol=null)
 
 wrapFieldForWhere ( $table, &$col, &$val)
 

Private Attributes

string $defaultCharset = 'AL32UTF8'
 Character set for Oracle database.
 
bool $ignoreDupValOnIndex = false
 
array $mFieldInfoCache = []
 
int $mInsertId = null
 
bool array $sequenceData = null
 

Detailed Description

Definition at line 134 of file DatabaseOracle.php.

Constructor & Destructor Documentation

◆ __construct()

DatabaseOracle::__construct ( array  $p)

Definition at line 156 of file DatabaseOracle.php.

References $wgDBprefix, and global.

◆ __destruct()

DatabaseOracle::__destruct ( )

Definition at line 167 of file DatabaseOracle.php.

Member Function Documentation

◆ addIdentifierQuotes()

DatabaseOracle::addIdentifierQuotes (   $s)

Definition at line 1211 of file DatabaseOracle.php.

References $s, and DBO_DDLMODE.

◆ addQuotes()

DatabaseOracle::addQuotes (   $s)

Definition at line 1202 of file DatabaseOracle.php.

References $s, $wgContLang, and global.

◆ affectedRows()

DatabaseOracle::affectedRows ( )

Definition at line 463 of file DatabaseOracle.php.

◆ aggregateValue()

DatabaseOracle::aggregateValue (   $valuedata,
  $valuename = 'value' 
)

Return aggregated value function call.

Parameters
array$valuedata
string$valuename
Returns
mixed

Definition at line 913 of file DatabaseOracle.php.

◆ bitAnd()

DatabaseOracle::bitAnd (   $fieldLeft,
  $fieldRight 
)

Definition at line 1467 of file DatabaseOracle.php.

◆ bitNot()

DatabaseOracle::bitNot (   $field)

Definition at line 1462 of file DatabaseOracle.php.

◆ bitOr()

DatabaseOracle::bitOr (   $fieldLeft,
  $fieldRight 
)

Definition at line 1471 of file DatabaseOracle.php.

◆ buildGroupConcatField()

DatabaseOracle::buildGroupConcatField (   $delim,
  $table,
  $field,
  $conds = '',
  $join_conds = [] 
)

Definition at line 1483 of file DatabaseOracle.php.

◆ buildStringCast()

DatabaseOracle::buildStringCast (   $field)
Parameters
string$fieldField or column to cast
Returns
string
Since
1.28

Definition at line 1496 of file DatabaseOracle.php.

◆ closeConnection()

DatabaseOracle::closeConnection ( )
protected

Closes a database connection, if it is open Returns success, true if already closed.

Returns
bool

Definition at line 287 of file DatabaseOracle.php.

◆ dataSeek()

DatabaseOracle::dataSeek (   $res,
  $row 
)
Parameters
mixed$res
int$row

Definition at line 435 of file DatabaseOracle.php.

References $res.

◆ decodeBlob()

DatabaseOracle::decodeBlob (   $b)

Definition at line 833 of file DatabaseOracle.php.

◆ delete()

DatabaseOracle::delete (   $table,
  $conds,
  $fname = __METHOD__ 
)

Definition at line 1314 of file DatabaseOracle.php.

References $fname, and tableName().

◆ doBegin()

DatabaseOracle::doBegin (   $fname = __METHOD__)
protected

Definition at line 1064 of file DatabaseOracle.php.

◆ doCommit()

DatabaseOracle::doCommit (   $fname = __METHOD__)
protected

Definition at line 1069 of file DatabaseOracle.php.

References $ret.

◆ doQuery()

DatabaseOracle::doQuery (   $sql)
protected

Definition at line 295 of file DatabaseOracle.php.

References code, DBO_DDLMODE, FROM, MWTimestamp\getLocalInstance(), StringUtils\isUtf8(), message, and wfDebug().

Referenced by open().

◆ doRollback()

DatabaseOracle::doRollback (   $fname = __METHOD__)
protected

Definition at line 1080 of file DatabaseOracle.php.

◆ dropTable()

DatabaseOracle::dropTable (   $tableName,
  $fName = __METHOD__ 
)

Definition at line 893 of file DatabaseOracle.php.

References tableName().

◆ duplicateTableStructure()

DatabaseOracle::duplicateTableStructure (   $oldName,
  $newName,
  $temporary = false,
  $fname = __METHOD__ 
)

Definition at line 852 of file DatabaseOracle.php.

◆ encodeBlob()

DatabaseOracle::encodeBlob (   $b)

Definition at line 829 of file DatabaseOracle.php.

◆ execFlags()

DatabaseOracle::execFlags ( )

Definition at line 291 of file DatabaseOracle.php.

◆ fetchObject()

DatabaseOracle::fetchObject (   $res)
Parameters
ResultWrapper | ORAResult$res
Returns
mixed

Definition at line 375 of file DatabaseOracle.php.

References $res.

◆ fetchRow()

DatabaseOracle::fetchRow (   $res)
Parameters
ResultWrapper | ORAResult$res
Returns
mixed

Definition at line 387 of file DatabaseOracle.php.

References $res.

◆ fieldBindStatement()

DatabaseOracle::fieldBindStatement (   $table,
  $col,
$val,
  $includeCol = false 
)
private

Definition at line 512 of file DatabaseOracle.php.

◆ fieldInfo()

DatabaseOracle::fieldInfo (   $table,
  $field 
)
Exceptions
DBUnexpectedError
Parameters
string$table
string$field
Returns
ORAField

Definition at line 1056 of file DatabaseOracle.php.

◆ fieldInfoMulti()

DatabaseOracle::fieldInfoMulti (   $table,
  $field 
)
private

Function translates mysql_fetch_field() functionality on ORACLE.

Caching is present for reducing query time. For internal calls. Use fieldInfo for normal usage. Returns false if the field doesn't exist

Parameters
array | string$table
string$field
Returns
ORAField|ORAResult

Definition at line 998 of file DatabaseOracle.php.

References $e, $res, and as.

◆ fieldName()

DatabaseOracle::fieldName (   $stmt,
  $n 
)

Definition at line 419 of file DatabaseOracle.php.

◆ freeResult()

DatabaseOracle::freeResult (   $res)

Frees resources associated with the LOB descriptor.

Parameters
ResultWrapper | ORAResult$res

Definition at line 363 of file DatabaseOracle.php.

References $res.

◆ getDBname()

DatabaseOracle::getDBname ( )

Definition at line 1475 of file DatabaseOracle.php.

◆ getInfinity()

DatabaseOracle::getInfinity ( )

Definition at line 1500 of file DatabaseOracle.php.

◆ getSequenceData()

DatabaseOracle::getSequenceData (   $table)
private

Return sequence_name if table has a sequence.

Parameters
string$table
Returns
bool

Definition at line 780 of file DatabaseOracle.php.

References tableName().

◆ getServer()

DatabaseOracle::getServer ( )

Definition at line 1479 of file DatabaseOracle.php.

◆ getServerVersion()

DatabaseOracle::getServerVersion ( )
Returns
string Version information from the database

Definition at line 927 of file DatabaseOracle.php.

◆ getSoftwareLink()

DatabaseOracle::getSoftwareLink ( )
Returns
string Wikitext of a link to the server software's web site

Definition at line 920 of file DatabaseOracle.php.

◆ getType()

DatabaseOracle::getType ( )

Definition at line 175 of file DatabaseOracle.php.

◆ implicitGroupby()

DatabaseOracle::implicitGroupby ( )

Definition at line 179 of file DatabaseOracle.php.

◆ implicitOrderby()

DatabaseOracle::implicitOrderby ( )

Definition at line 183 of file DatabaseOracle.php.

◆ indexExists()

DatabaseOracle::indexExists (   $table,
  $index,
  $fname = __METHOD__ 
)

Query whether a given index exists.

Parameters
string$table
string$index
string$fname
Returns
bool

Definition at line 948 of file DatabaseOracle.php.

References $count, $res, and tableName().

◆ indexInfo()

DatabaseOracle::indexInfo (   $table,
  $index,
  $fname = __METHOD__ 
)

Returns information about an index If errors are explicitly ignored, returns NULL on failure.

Parameters
string$table
string$index
string$fname
Returns
bool

Definition at line 475 of file DatabaseOracle.php.

◆ indexUnique()

DatabaseOracle::indexUnique (   $table,
  $index,
  $fname = __METHOD__ 
)

Definition at line 479 of file DatabaseOracle.php.

◆ insert()

DatabaseOracle::insert (   $table,
  $a,
  $fname = __METHOD__,
  $options = [] 
)

Definition at line 483 of file DatabaseOracle.php.

References $fname, $options, and as.

◆ insertId()

DatabaseOracle::insertId ( )

This must be called after nextSequenceVal.

Returns
null|int

Definition at line 427 of file DatabaseOracle.php.

◆ insertOneRow()

DatabaseOracle::insertOneRow (   $table,
  $row,
  $fname 
)
private
Parameters
string$table
array$row
string$fname
Returns
bool
Exceptions
DBUnexpectedError

Definition at line 554 of file DatabaseOracle.php.

References $e, $wgContLang, as, false, global, and tableName().

◆ isQuotedIdentifier()

DatabaseOracle::isQuotedIdentifier (   $s)

Definition at line 1223 of file DatabaseOracle.php.

References $s.

◆ lastErrno()

DatabaseOracle::lastErrno ( )

Definition at line 453 of file DatabaseOracle.php.

References $e.

◆ lastError()

DatabaseOracle::lastError ( )

Definition at line 443 of file DatabaseOracle.php.

References $e.

Referenced by open().

◆ limitResult()

DatabaseOracle::limitResult (   $sql,
  $limit,
  $offset = false 
)

Definition at line 821 of file DatabaseOracle.php.

◆ listTables()

DatabaseOracle::listTables (   $prefix = null,
  $fname = __METHOD__ 
)

Definition at line 868 of file DatabaseOracle.php.

◆ makeSelectOptions()

DatabaseOracle::makeSelectOptions (   $options)

Returns an optional USE INDEX clause to go after the table, and a string to go at the end of the query.

Parameters
array$optionsAn associative array of options to be turned into an SQL query, valid keys are listed in the function.
Returns
array

Definition at line 1276 of file DatabaseOracle.php.

References $options, and as.

◆ nativeInsertSelect()

DatabaseOracle::nativeInsertSelect (   $destTable,
  $srcTable,
  $varMap,
  $conds,
  $fname = __METHOD__,
  $insertOptions = [],
  $selectOptions = [] 
)

Definition at line 661 of file DatabaseOracle.php.

References list, and tableName().

◆ nextSequenceValue()

DatabaseOracle::nextSequenceValue (   $seqName)

Return the next in a sequence, save the value for retrieval via insertId()

Parameters
string$seqName
Returns
null|int

Definition at line 766 of file DatabaseOracle.php.

References $res, and query.

◆ numFields()

DatabaseOracle::numFields (   $res)
Parameters
ResultWrapper | ORAResult$res
Returns
int

Definition at line 411 of file DatabaseOracle.php.

References $res.

◆ numRows()

DatabaseOracle::numRows (   $res)
Parameters
ResultWrapper | ORAResult$res
Returns
int

Definition at line 399 of file DatabaseOracle.php.

References $res.

◆ open()

DatabaseOracle::open (   $server,
  $user,
  $password,
  $dbName 
)

Usually aborts on failure.

Parameters
string$server
string$user
string$password
string$dbName
Exceptions
DBConnectionError
Returns
resource|null

Definition at line 196 of file DatabaseOracle.php.

References $user, $wgDBOracleDRCP, DBO_DEFAULT, DBO_PERSISTENT, DBO_SYSDBA, doQuery(), e, global, is(), lastError(), return, and selectDB().

◆ queryIgnore()

DatabaseOracle::queryIgnore (   $sql,
  $fname = '' 
)

Definition at line 355 of file DatabaseOracle.php.

References $fname, and query.

◆ removeIdentifierQuotes()

DatabaseOracle::removeIdentifierQuotes (   $s)

Definition at line 1219 of file DatabaseOracle.php.

References $s.

◆ selectDB()

DatabaseOracle::selectDB (   $db)

Definition at line 1176 of file DatabaseOracle.php.

References $e, and $success.

Referenced by open().

◆ selectRow()

DatabaseOracle::selectRow (   $table,
  $vars,
  $conds,
  $fname = __METHOD__,
  $options = [],
  $join_conds = [] 
)

Definition at line 1258 of file DatabaseOracle.php.

References $fname, $options, and $vars.

◆ sourceStream()

DatabaseOracle::sourceStream (   $fp,
  $lineCallback = false,
  $resultCallback = false,
  $fname = __METHOD__,
  $inputCallback = false 
)

defines must comply with ^define\s*([^\s=]*)\s*=\s?'\{\$([^\}]*)\}';

Parameters
resource$fp
bool | string$lineCallback
bool | callable$resultCallback
string$fname
bool | callable$inputCallback
Returns
bool|string

Definition at line 1098 of file DatabaseOracle.php.

References $line, $res, and as.

◆ strencode()

DatabaseOracle::strencode (   $s)

Definition at line 1198 of file DatabaseOracle.php.

References $s.

◆ tableExists()

DatabaseOracle::tableExists (   $table,
  $fname = __METHOD__ 
)

Query whether a given table exists (in the given schema, or the default mw one if not given)

Parameters
string$table
string$fname
Returns
bool

Definition at line 971 of file DatabaseOracle.php.

References $res, and tableName().

◆ tableName()

DatabaseOracle::tableName (   $name,
  $format = 'quoted' 
)

Definition at line 736 of file DatabaseOracle.php.

References $name.

◆ tableNameInternal()

DatabaseOracle::tableNameInternal (   $name)

Definition at line 754 of file DatabaseOracle.php.

References $name, and tableName().

◆ textFieldSize()

DatabaseOracle::textFieldSize (   $table,
  $field 
)

Returns the size of a text field, or -1 for "unlimited".

Parameters
string$table
string$field
Returns
mixed

Definition at line 815 of file DatabaseOracle.php.

◆ timestamp()

DatabaseOracle::timestamp (   $ts = 0)

Definition at line 902 of file DatabaseOracle.php.

References TS_ORACLE, and wfTimestamp().

◆ unionQueries()

DatabaseOracle::unionQueries (   $sqls,
  $all 
)

Definition at line 841 of file DatabaseOracle.php.

◆ update()

DatabaseOracle::update (   $table,
  $values,
  $conds,
  $fname = __METHOD__,
  $options = [] 
)
Parameters
string$table
array$values
array$conds
string$fname
array$options
Returns
bool
Exceptions
DBUnexpectedError

Definition at line 1357 of file DatabaseOracle.php.

References $e, $options, $wgContLang, as, false, global, LIST_AND, and tableName().

◆ upsert()

DatabaseOracle::upsert (   $table,
array  $rows,
array  $uniqueIndexes,
array  $set,
  $fname = __METHOD__ 
)

Definition at line 710 of file DatabaseOracle.php.

◆ wasDeadlock()

DatabaseOracle::wasDeadlock ( )

Definition at line 848 of file DatabaseOracle.php.

◆ wrapConditionsForWhere()

DatabaseOracle::wrapConditionsForWhere (   $table,
  $conds,
  $parentCol = null 
)
private

Definition at line 1240 of file DatabaseOracle.php.

References as.

◆ wrapFieldForWhere()

DatabaseOracle::wrapFieldForWhere (   $table,
$col,
$val 
)
private

Definition at line 1227 of file DatabaseOracle.php.

References $wgContLang, and global.

Member Data Documentation

◆ $defaultCharset

string DatabaseOracle::$defaultCharset = 'AL32UTF8'
private

Character set for Oracle database.

Definition at line 151 of file DatabaseOracle.php.

◆ $ignoreDupValOnIndex

bool DatabaseOracle::$ignoreDupValOnIndex = false
private

Definition at line 145 of file DatabaseOracle.php.

◆ $mAffectedRows

int DatabaseOracle::$mAffectedRows
protected

The number of rows affected as an integer.

Definition at line 139 of file DatabaseOracle.php.

◆ $mFieldInfoCache

array DatabaseOracle::$mFieldInfoCache = []
private

Definition at line 154 of file DatabaseOracle.php.

◆ $mInsertId

int DatabaseOracle::$mInsertId = null
private

Definition at line 142 of file DatabaseOracle.php.

◆ $mLastResult

resource DatabaseOracle::$mLastResult = null
protected

Definition at line 136 of file DatabaseOracle.php.

◆ $sequenceData

bool array DatabaseOracle::$sequenceData = null
private

Definition at line 148 of file DatabaseOracle.php.


The documentation for this class was generated from the following file: