DatabaseIbm_db2 Class Reference
[Database]

Primary database interface. More...

Inherits Database.

List of all members.

Public Member Functions

 cascadingDeletes ()
 Returns true if this database supports (and uses) cascading deletes.
 cleanupTriggers ()
 Returns true if this database supports (and uses) triggers (e.g.
 strictIPs ()
 Returns true if this database is strict about what can be put into an IP field.
 realTimestamps ()
 Returns true if this database uses timestamps rather than integers.
 implicitGroupby ()
 Returns true if this database does an implicit sort when doing GROUP BY.
 implicitOrderby ()
 Returns true if this database does an implicit order by when the column has an index For example: SELECT page_title FROM page LIMIT 1.
 searchableIPs ()
 Returns true if this database can do a native search on IP columns e.g.
 functionalIndexes ()
 Returns true if this database can use functional indexes.
 getWikiID ()
 Returns a unique string representing the wiki on the server.
 DatabaseIbm_db2 ($server=false, $user=false, $password=false, $dbName=false, $failFunction=false, $flags=0, $schema=self::USE_GLOBAL)
 open ($server, $user, $password, $dbName)
 Opens a database connection and returns it Closes any existing connection.
 close ()
 Closes a database connection, if it is open Returns success, true if already closed.
 lastError ()
 Retrieves the most current database error Forces a database rollback.
 lastErrno ()
 Get the last error number Return 0 if no error.
 isOpen ()
 Is a database connection open?
 doQuery ($sql)
 The DBMS-dependent part of query().
 getServerVersion ()
 tableExists ($table)
 Queries whether a given table exists.
 fetchObject ($res)
 Fetch the next row from the given result object, in object form.
 fetchRow ($res)
 Fetch the next row from the given result object, in associative array form.
 initial_setup ()
 Override if introduced to base Database class.
 setup_database ()
 Create tables, stored procedures, and so on.
 addQuotes ($s)
 Escapes strings Doesn't escape numbers.
 addQuotesSmart ($table, $field, $s)
 Escapes strings Only escapes numbers going into non-numeric fields.
 is_numeric_type ($type)
 Verifies that a DB2 column/field type is numeric.
 strencode ($s)
 Alias for addQuotes().
 begin ()
 Start a transaction (mandatory).
 commit ()
 End a transaction Must have a preceding begin().
 rollback ()
 Cancel a transaction.
 makeList ($a, $mode=LIST_COMMA)
 Makes an encoded list of strings from an array $mode: LIST_COMMA - comma separated, no field names LIST_AND - ANDed WHERE clause (without the WHERE) LIST_OR - ORed WHERE clause (without the WHERE) LIST_SET - comma separated with field names, like a SET clause LIST_NAMES - comma separated field names.
 makeListSmart ($table, $a, $mode=LIST_COMMA)
 Makes an encoded list of strings from an array Quotes numeric values being inserted into non-numeric fields.
 limitResult ($sql, $limit, $offset=false)
 Construct a LIMIT query with optional offset This is used for query pages $sql string SQL query we will append the limit too $limit integer the SQL limit $offset integer the SQL offset (default false).
 tableName ($name)
 Handle reserved keyword replacement in table names.
 timestamp ($ts=0)
 Generates a timestamp in an insertable format.
 nextSequenceValue ($seqName)
 Return the next in a sequence, save the value for retrieval via insertId().
 insertId ()
 This must be called after nextSequenceVal.
 insert ($table, $args, $fname= 'DatabaseIbm_db2::insert', $options=array())
 INSERT wrapper, inserts an array into a table.
 update ($table, $values, $conds, $fname= 'Database::update', $options=array())
 UPDATE wrapper, takes a condition array and a SET array.
 delete ($table, $conds, $fname= 'Database::delete')
 DELETE query wrapper.
 affectedRows ()
 Returns the number of rows affected by the last query or 0.
 useIndexClause ($index)
 USE INDEX clause DB2 doesn't have them and returns "".
 replace ($table, $uniqueIndexes, $rows, $fname= 'DatabaseIbm_db2::replace')
 Simulates REPLACE with a DELETE followed by INSERT.
 numRows ($res)
 Returns the number of rows in the result set Has to be called right after the corresponding select query.
 dataSeek ($res, $row)
 Moves the row pointer of the result set.
 freeResult ($res)
 Frees memory associated with a statement resource.
 numFields ($res)
 Returns the number of columns in a resource.
 fieldName ($res, $n)
 Returns the nth column name.
 select ($table, $vars, $conds='', $fname= 'DatabaseIbm_db2::select', $options=array(), $join_conds=array())
 SELECT wrapper.
 makeSelectOptions ($options)
 Handles ordering, grouping, and having options ('GROUP BY' => colname) Has limited support for per-column options (colnum => 'DISTINCT').
 getSoftwareLink ()
 Returns link to IBM DB2 free download.
 selectDB ($db)
 Does nothing.
 conditional ($cond, $trueVal, $falseVal)
 Returns an SQL expression for a simple conditional.
 getSearchEngine ()
 Get search engine class.
 wasDeadlock ()
 Did the last database access fail because of deadlock?
 ping ()
 Ping the server and try to reconnect if it there is no connection The connection may be closed and reopened while this happens.
 getStatus ($which)
 Not implemented.
 setTimeout ($timeout)
 Not implemented.
 lock ($lockName, $method)
 Not implemented TODO.
 unlock ($lockName, $method)
 Not implemented TODO.
 setFakeSlaveLag ($lag)
 Not implemented.
 setFakeMaster ($enabled)
 Not implemented.
 limitResultForUpdate ($sql, $num)
 Not implemented.
 lowPriorityOption ()
 No such option.
 fieldExists ($table, $field, $fname= 'DatabaseIbm_db2::fieldExists')
 Query whether a given column exists in the mediawiki schema.
 indexInfo ($table, $index, $fname= 'DatabaseIbm_db2::indexExists')
 Returns information about an index If errors are explicitly ignored, returns NULL on failure.
 fieldInfo ($table, $field)
 Returns an information object on a table column.
 fieldType ($res, $index)
 db2_field_type() wrapper
 indexUnique ($table, $index, $fname= 'Database::indexUnique')
 Verifies that an index was created as unique.
 textFieldSize ($table, $field)
 Returns the size of a text field, or -1 for "unlimited".
 deleteJoin ($delTable, $joinTable, $delVar, $joinVar, $conds, $fname="DatabaseIbm_db2::deleteJoin")
 DELETE where the condition is a join.
 estimateRowCount ($table, $vars='*', $conds='', $fname= 'Database::estimateRowCount', $options=array())
 Estimate rows in dataset Returns estimated count, based on COUNT(*) output Takes same arguments as Database::select().
 encodeBlob ($b)
 Description is left as an exercise for the reader.
 decodeBlob ($b)
 Description is left as an exercise for the reader.
 buildConcat ($stringList)
 Convert into a list of string being concatenated.
 extractUnixEpoch ($column)
 Generates the SQL required to convert a DB2 timestamp into a Unix epoch.

Static Public Member Functions

static newFromParams ($server, $user, $password, $dbName, $failFunction=false, $flags=0)
 Returns a fresh instance of this class.

Public Attributes

const CATALOGED = "cataloged"
const UNCATALOGED = "uncataloged"
const USE_GLOBAL = "get from global"

Protected Member Functions

 openCataloged ($dbName, $user, $password)
 Opens a cataloged database connection, sets mConn.
 openUncataloged ($dbName, $user, $password, $server, $port)
 Opens an uncataloged database connection, sets mConn.
 applySchema ()
 Switch into the database schema.

Protected Attributes

 $mPort = NULL
 Server port for uncataloged connections.
 $mCataloged = NULL
 Whether connection is cataloged.
 $mSchema = NULL
 Schema for tables, stored procedures, triggers.
 $mSchemaSet = false
 Whether the schema has been applied in this session.
 $mLastResult = NULL
 Result of last query.
 $mAffectedRows = NULL
 Number of rows affected by last INSERT/UPDATE/DELETE.
 $mNumRows = NULL
 Number of rows returned by last SELECT.
 $mInsertId = NULL
 Last sequence value used for a primary key.

Private Member Functions

 lastError2 ()


Detailed Description

Primary database interface.

Definition at line 105 of file DatabaseIbm_db2.php.


Member Function Documentation

DatabaseIbm_db2::addQuotes ( s  ) 

Escapes strings Doesn't escape numbers.

Parameters:
string s string to escape
Returns:
escaped string

Reimplemented from Database.

Definition at line 731 of file DatabaseIbm_db2.php.

References $s, and strencode().

Referenced by makeList(), makeListSmart(), and replace().

DatabaseIbm_db2::addQuotesSmart ( table,
field,
s 
)

Escapes strings Only escapes numbers going into non-numeric fields.

Parameters:
string s string to escape
Returns:
escaped string

Definition at line 753 of file DatabaseIbm_db2.php.

References $res, $s, $type, doQuery(), is_numeric_type(), strencode(), and wfDebug().

Referenced by makeListSmart().

DatabaseIbm_db2::affectedRows (  ) 

Returns the number of rows affected by the last query or 0.

Returns:
int the number of rows affected by the last query

Reimplemented from Database.

Definition at line 1230 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::applySchema (  )  [protected]

Switch into the database schema.

Definition at line 821 of file DatabaseIbm_db2.php.

References begin(), commit(), and doQuery().

Referenced by doQuery(), open(), and setup_database().

DatabaseIbm_db2::begin (  ) 

Start a transaction (mandatory).

Definition at line 833 of file DatabaseIbm_db2.php.

Referenced by applySchema(), insert(), and setup_database().

DatabaseIbm_db2::buildConcat ( stringList  ) 

Convert into a list of string being concatenated.

Parameters:
array $stringList strings that need to be joined together by the SQL engine
Returns:
string joined by the concatenation operator

Reimplemented from Database.

Definition at line 1780 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::cascadingDeletes (  ) 

Returns true if this database supports (and uses) cascading deletes.

Reimplemented from Database.

Definition at line 312 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::cleanupTriggers (  ) 

Returns true if this database supports (and uses) triggers (e.g.

on the page table)

Reimplemented from Database.

Definition at line 319 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::close (  ) 

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

Reimplemented from Database.

Definition at line 512 of file DatabaseIbm_db2.php.

References commit(), and Database::trxLevel().

Referenced by open(), and ping().

DatabaseIbm_db2::commit (  ) 

End a transaction Must have a preceding begin().

Definition at line 843 of file DatabaseIbm_db2.php.

Referenced by applySchema(), close(), insert(), and setup_database().

DatabaseIbm_db2::conditional ( cond,
trueVal,
falseVal 
)

Returns an SQL expression for a simple conditional.

Uses CASE on DB2

Parameters:
string $cond SQL expression which will result in a boolean value
string $trueVal SQL expression to return if true
string $falseVal SQL expression to return if false
Returns:
string SQL fragment

Reimplemented from Database.

Definition at line 1483 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::DatabaseIbm_db2 ( server = false,
user = false,
password = false,
dbName = false,
failFunction = false,
flags = 0,
schema = self::USE_GLOBAL 
)

Parameters:
string $server hostname of database server
string $user username
string $password
string $dbName database name on the server
function $failFunction (optional)
integer $flags database behaviour flags (optional, unused)

Definition at line 394 of file DatabaseIbm_db2.php.

References $flags, $password, $user, $wgDBmwschema, $wgOut, and open().

Referenced by newFromParams().

DatabaseIbm_db2::dataSeek ( res,
row 
)

Moves the row pointer of the result set.

Parameters:
Object $res result set
int $row row number
Returns:
success or failure

Reimplemented from Database.

Definition at line 1330 of file DatabaseIbm_db2.php.

References $res, and $row.

DatabaseIbm_db2::decodeBlob ( b  ) 

Description is left as an exercise for the reader.

Parameters:
IBM_DB2Blob $b data to be decoded
Returns:
mixed

Reimplemented from Database.

Definition at line 1771 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::delete ( table,
conds,
fname = 'Database::delete' 
)

DELETE query wrapper.

Use $conds == "*" to delete all rows

Reimplemented from Database.

Definition at line 1214 of file DatabaseIbm_db2.php.

References $conds, $fname, $sql, makeListSmart(), Database::query(), and tableName().

DatabaseIbm_db2::deleteJoin ( delTable,
joinTable,
delVar,
joinVar,
conds,
fname = "DatabaseIbm_db2::deleteJoin" 
)

DELETE where the condition is a join.

Parameters:
string $delTable deleting from this table
string $joinTable using data from this table
string $delVar variable in deleteable table
string $joinVar variable in data table
array $conds conditionals for join table
string $fname function name for profiling

Reimplemented from Database.

Definition at line 1719 of file DatabaseIbm_db2.php.

References $conds, $fname, $sql, makeList(), Database::query(), and tableName().

DatabaseIbm_db2::doQuery ( sql  ) 

The DBMS-dependent part of query().

Parameters:
$sql String: SQL query.
Returns:
object Result object to feed to fetchObject, fetchRow, ...; or false on failure
Access:
private

Reimplemented from Database.

Definition at line 590 of file DatabaseIbm_db2.php.

References $error, $sql, applySchema(), and print.

Referenced by addQuotesSmart(), and applySchema().

DatabaseIbm_db2::encodeBlob ( b  ) 

Description is left as an exercise for the reader.

Parameters:
mixed $b data to be encoded
Returns:
IBM_DB2Blob

Reimplemented from Database.

Definition at line 1762 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::estimateRowCount ( table,
vars = '*',
conds = '',
fname = 'Database::estimateRowCount',
options = array() 
)

Estimate rows in dataset Returns estimated count, based on COUNT(*) output Takes same arguments as Database::select().

Parameters:
string $table table name
array $vars unused
array $conds filters on the table
string $fname function name for profiling
array $options options for select
Returns:
int row count

Reimplemented from Database.

Definition at line 1746 of file DatabaseIbm_db2.php.

References $conds, $fname, $options, $res, $row, $rows, fetchRow(), freeResult(), and select().

DatabaseIbm_db2::extractUnixEpoch ( column  ) 

Generates the SQL required to convert a DB2 timestamp into a Unix epoch.

Parameters:
string $column name of timestamp column
Returns:
string SQL code

Definition at line 1791 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::fetchObject ( res  ) 

Fetch the next row from the given result object, in object form.

Fields can be retrieved with $row->fieldname, with fields acting like member variables.

Parameters:
$res SQL result object as returned from Database::query(), etc.
Returns:
DB2 row object
Exceptions:
DBUnexpectedError Thrown if the database returns an error

Reimplemented from Database.

Definition at line 648 of file DatabaseIbm_db2.php.

References $key, $res, $row, lastErrno(), and lastError().

Referenced by indexInfo(), indexUnique(), select(), and textFieldSize().

DatabaseIbm_db2::fetchRow ( res  ) 

Fetch the next row from the given result object, in associative array form.

Fields are retrieved with $row['fieldname'].

Parameters:
$res SQL result object as returned from Database::query(), etc.
Returns:
DB2 row object
Exceptions:
DBUnexpectedError Thrown if the database returns an error

Reimplemented from Database.

Definition at line 678 of file DatabaseIbm_db2.php.

References $res, $row, lastErrno(), and lastError().

Referenced by estimateRowCount(), nextSequenceValue(), and tableExists().

DatabaseIbm_db2::fieldExists ( table,
field,
fname = 'DatabaseIbm_db2::fieldExists' 
)

Query whether a given column exists in the mediawiki schema.

Parameters:
string $table name of the table
string $field name of the column
string $fname function name for logging and profiling

Reimplemented from Database.

Definition at line 1599 of file DatabaseIbm_db2.php.

References $count, $fname, $res, $sql, freeResult(), numRows(), Database::query(), and tableName().

DatabaseIbm_db2::fieldInfo ( table,
field 
)

Returns an information object on a table column.

Parameters:
string $table table name
string $field column name
Returns:
IBM_DB2Field

Reimplemented from Database.

Definition at line 1647 of file DatabaseIbm_db2.php.

References IBM_DB2Field::fromText().

DatabaseIbm_db2::fieldName ( res,
n 
)

Returns the nth column name.

Parameters:
Object $res Statement resource
int $n Index of field or column
Returns:
string name of nth column

Reimplemented from Database.

Definition at line 1373 of file DatabaseIbm_db2.php.

References $n, and $res.

DatabaseIbm_db2::fieldType ( res,
index 
)

db2_field_type() wrapper

Parameters:
Object $res Result of executed statement
mixed $index number or name of the column
Returns:
string column type

Reimplemented from Database.

Definition at line 1657 of file DatabaseIbm_db2.php.

References $res.

DatabaseIbm_db2::freeResult ( res  ) 

Frees memory associated with a statement resource.

Parameters:
Object $res Statement resource to free
Returns:
bool success or failure

Reimplemented from Database.

Definition at line 1346 of file DatabaseIbm_db2.php.

References $res.

Referenced by estimateRowCount(), fieldExists(), nextSequenceValue(), and textFieldSize().

DatabaseIbm_db2::functionalIndexes (  ) 

Returns true if this database can use functional indexes.

Reimplemented from Database.

Definition at line 364 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::getSearchEngine (  ) 

Get search engine class.

All subclasses of this need to implement this if they wish to use searching.

Returns:
string

Reimplemented from Database.

Definition at line 1496 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::getServerVersion (  ) 

Returns:
string Version information from the database

Reimplemented from Database.

Definition at line 611 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::getSoftwareLink (  ) 

Returns link to IBM DB2 free download.

Returns:
string wikitext of a link to the server software's web site

Reimplemented from Database.

Definition at line 1461 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::getStatus ( which  ) 

Not implemented.

Returns:
string ''
Deprecated:

Reimplemented from Database.

Definition at line 1548 of file DatabaseIbm_db2.php.

References wfDebug().

DatabaseIbm_db2::getWikiID (  ) 

Returns a unique string representing the wiki on the server.

Reimplemented from Database.

Definition at line 371 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::implicitGroupby (  ) 

Returns true if this database does an implicit sort when doing GROUP BY.

Reimplemented from Database.

Definition at line 341 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::implicitOrderby (  ) 

Returns true if this database does an implicit order by when the column has an index For example: SELECT page_title FROM page LIMIT 1.

Reimplemented from Database.

Definition at line 349 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::indexInfo ( table,
index,
fname = 'DatabaseIbm_db2::indexExists' 
)

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

Parameters:
string $table table name
string $index index name
string 
Returns:
object query row in object form

Reimplemented from Database.

Definition at line 1625 of file DatabaseIbm_db2.php.

References $fname, $res, $row, $sql, fetchObject(), Database::query(), and tableName().

DatabaseIbm_db2::indexUnique ( table,
index,
fname = 'Database::indexUnique' 
)

Verifies that an index was created as unique.

Parameters:
string $table table name
string $index index name
string $fnam function name for profiling
Returns:
bool

Definition at line 1671 of file DatabaseIbm_db2.php.

References $fname, $res, $sql, fetchObject(), Database::query(), and tableName().

DatabaseIbm_db2::initial_setup (  ) 

Override if introduced to base Database class.

Definition at line 692 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::insert ( table,
args,
fname = 'DatabaseIbm_db2::insert',
options = array() 
)

INSERT wrapper, inserts an array into a table.

$args may be a single associative array, or an array of these with numeric keys, for multi-row insert

Parameters:
array $table String: Name of the table to insert to.
array $args Array: Items to insert into the table.
array $fname String: Name of the function, for profiling
mixed $options String or Array. Valid options: IGNORE
Returns:
bool Success of insert operation. IGNORE always returns true.

Reimplemented from Database.

Definition at line 1084 of file DatabaseIbm_db2.php.

References $args, $fname, $ignore, $keys, $options, $res, $row, $sql, begin(), commit(), makeListSmart(), Database::query(), tableName(), and wfDebug().

DatabaseIbm_db2::insertId (  ) 

This must be called after nextSequenceVal.

Returns:
Last sequence value used as a primary key

Reimplemented from Database.

Definition at line 1067 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::is_numeric_type ( type  ) 

Verifies that a DB2 column/field type is numeric.

Returns:
bool true if numeric
Parameters:
string $type DB2 column type

Definition at line 784 of file DatabaseIbm_db2.php.

References $type.

Referenced by addQuotesSmart().

DatabaseIbm_db2::isOpen (  ) 

Is a database connection open?

Returns:

Reimplemented from Database.

Definition at line 581 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::lastErrno (  ) 

Get the last error number Return 0 if no error.

Returns:
integer

Reimplemented from Database.

Definition at line 569 of file DatabaseIbm_db2.php.

Referenced by fetchObject(), fetchRow(), and wasDeadlock().

DatabaseIbm_db2::lastError (  ) 

Retrieves the most current database error Forces a database rollback.

Reimplemented from Database.

Definition at line 545 of file DatabaseIbm_db2.php.

References lastError2(), and rollback().

Referenced by fetchObject(), fetchRow(), and open().

DatabaseIbm_db2::lastError2 (  )  [private]

Definition at line 553 of file DatabaseIbm_db2.php.

Referenced by lastError().

DatabaseIbm_db2::limitResult ( sql,
limit,
offset = false 
)

Construct a LIMIT query with optional offset This is used for query pages $sql string SQL query we will append the limit too $limit integer the SQL limit $offset integer the SQL offset (default false).

Reimplemented from Database.

Definition at line 1010 of file DatabaseIbm_db2.php.

References $offset, and wfDebug().

DatabaseIbm_db2::limitResultForUpdate ( sql,
num 
)

Not implemented.

Returns:
string $sql
Deprecated:

Reimplemented from Database.

Definition at line 1581 of file DatabaseIbm_db2.php.

References $sql.

DatabaseIbm_db2::lock ( lockName,
method 
)

Not implemented TODO.

Returns:
bool true

Reimplemented from Database.

Definition at line 1559 of file DatabaseIbm_db2.php.

References wfDebug().

DatabaseIbm_db2::lowPriorityOption (  ) 

No such option.

Returns:
string ''
Deprecated:

Reimplemented from Database.

Definition at line 1587 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::makeList ( a,
mode = LIST_COMMA 
)

Makes an encoded list of strings from an array $mode: LIST_COMMA - comma separated, no field names LIST_AND - ANDed WHERE clause (without the WHERE) LIST_OR - ORed WHERE clause (without the WHERE) LIST_SET - comma separated with field names, like a SET clause LIST_NAMES - comma separated field names.

Reimplemented from Database.

Definition at line 870 of file DatabaseIbm_db2.php.

References $mode, addQuotes(), and wfDebug().

Referenced by deleteJoin(), makeListSmart(), and replace().

DatabaseIbm_db2::makeListSmart ( table,
a,
mode = LIST_COMMA 
)

Makes an encoded list of strings from an array Quotes numeric values being inserted into non-numeric fields.

Returns:
string
Parameters:
string $table name of the table
array $a list of values
$mode,: LIST_COMMA - comma separated, no field names LIST_AND - ANDed WHERE clause (without the WHERE) LIST_OR - ORed WHERE clause (without the WHERE) LIST_SET - comma separated with field names, like a SET clause LIST_NAMES - comma separated field names

Definition at line 946 of file DatabaseIbm_db2.php.

References $mode, addQuotes(), addQuotesSmart(), and makeList().

Referenced by delete(), insert(), and update().

DatabaseIbm_db2::makeSelectOptions ( options  ) 

Handles ordering, grouping, and having options ('GROUP BY' => colname) Has limited support for per-column options (colnum => 'DISTINCT').

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

Reimplemented from Database.

Definition at line 1437 of file DatabaseIbm_db2.php.

References $key, and $options.

static DatabaseIbm_db2::newFromParams ( server,
user,
password,
dbName,
failFunction = false,
flags = 0 
) [static]

Returns a fresh instance of this class.

Returns:
Parameters:
string $server hostname of database server
string $user username
string $password
string $dbName database name on the server
function $failFunction (optional)
integer $flags database behaviour flags (optional, unused)

Reimplemented from Database.

Definition at line 536 of file DatabaseIbm_db2.php.

References $flags, $password, $user, and DatabaseIbm_db2().

DatabaseIbm_db2::nextSequenceValue ( seqName  ) 

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

Parameters:
string seqName Name of a defined sequence in the database
Returns:
next value in that sequence

Reimplemented from Database.

Definition at line 1054 of file DatabaseIbm_db2.php.

References $res, $row, fetchRow(), freeResult(), and Database::query().

DatabaseIbm_db2::numFields ( res  ) 

Returns the number of columns in a resource.

Parameters:
Object $res Statement resource
Returns:
Number of fields/columns in resource

Reimplemented from Database.

Definition at line 1360 of file DatabaseIbm_db2.php.

References $res.

DatabaseIbm_db2::numRows ( res  ) 

Returns the number of rows in the result set Has to be called right after the corresponding select query.

Parameters:
Object $res result set
Returns:
int number of rows

Reimplemented from Database.

Definition at line 1312 of file DatabaseIbm_db2.php.

References $res.

Referenced by fieldExists().

DatabaseIbm_db2::open ( server,
user,
password,
dbName 
)

Opens a database connection and returns it Closes any existing connection.

Returns:
a fresh connection
Parameters:
string $server hostname
string $user
string $password
string $dbName database name

Reimplemented from Database.

Definition at line 427 of file DatabaseIbm_db2.php.

References $error, $password, $user, applySchema(), close(), lastError(), openCataloged(), openUncataloged(), Database::reportConnectionError(), wfDebug(), wfProfileIn(), and wfProfileOut().

Referenced by DatabaseIbm_db2().

DatabaseIbm_db2::openCataloged ( dbName,
user,
password 
) [protected]

Opens a cataloged database connection, sets mConn.

Definition at line 487 of file DatabaseIbm_db2.php.

References $password, and $user.

Referenced by open(), and ping().

DatabaseIbm_db2::openUncataloged ( dbName,
user,
password,
server,
port 
) [protected]

Opens an uncataloged database connection, sets mConn.

Definition at line 495 of file DatabaseIbm_db2.php.

References $password, and $user.

Referenced by open(), and ping().

DatabaseIbm_db2::ping (  ) 

Ping the server and try to reconnect if it there is no connection The connection may be closed and reopened while this happens.

Returns:
bool whether the connection exists

Reimplemented from Database.

Definition at line 1525 of file DatabaseIbm_db2.php.

References close(), openCataloged(), and openUncataloged().

DatabaseIbm_db2::realTimestamps (  ) 

Returns true if this database uses timestamps rather than integers.

Reimplemented from Database.

Definition at line 334 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::replace ( table,
uniqueIndexes,
rows,
fname = 'DatabaseIbm_db2::replace' 
)

Simulates REPLACE with a DELETE followed by INSERT.

Parameters:
$table Object
array $uniqueIndexes array consisting of indexes and arrays of indexes
array $rows Rows to insert
string $fname Name of the function for profiling
Returns:
nothing

Reimplemented from Database.

Definition at line 1257 of file DatabaseIbm_db2.php.

References $fname, $row, $rows, $sql, addQuotes(), makeList(), Database::query(), and tableName().

DatabaseIbm_db2::rollback (  ) 

Cancel a transaction.

Definition at line 853 of file DatabaseIbm_db2.php.

Referenced by lastError().

DatabaseIbm_db2::searchableIPs (  ) 

Returns true if this database can do a native search on IP columns e.g.

this works as expected: .. WHERE rc_ip = '127.42.12.102/32';

Reimplemented from Database.

Definition at line 357 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::select ( table,
vars,
conds = '',
fname = 'DatabaseIbm_db2::select',
options = array(),
join_conds = array() 
)

SELECT wrapper.

Parameters:
mixed $table Array or string, table name(s) (prefix auto-added)
mixed $vars Array or string, field name(s) to be retrieved
mixed $conds Array or string, condition(s) for WHERE
string $fname Calling function name (use __METHOD__) for logs/profiling
array $options Associative array of options (e.g. array('GROUP BY' => 'page_title')), see Database::makeSelectOptions code for list of supported stuff
array $join_conds Associative array of table join conditions (optional) (e.g. array( 'page' => array('LEFT JOIN','page_latest=rev_id') )
Returns:
mixed Database result resource (feed to Database::fetchObject or whatever), or false on failure

Reimplemented from Database.

Definition at line 1393 of file DatabaseIbm_db2.php.

References $conds, $fname, $obj, $offset, $options, $res, fetchObject(), and wfDebug().

Referenced by estimateRowCount().

DatabaseIbm_db2::selectDB ( db  ) 

Does nothing.

Parameters:
object $db
Returns:
bool true

Reimplemented from Database.

Definition at line 1470 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::setFakeMaster ( enabled  ) 

Not implemented.

Deprecated:

Reimplemented from Database.

Definition at line 1575 of file DatabaseIbm_db2.php.

References wfDebug().

DatabaseIbm_db2::setFakeSlaveLag ( lag  ) 

Not implemented.

Deprecated:

Reimplemented from Database.

Definition at line 1570 of file DatabaseIbm_db2.php.

References wfDebug().

DatabaseIbm_db2::setTimeout ( timeout  ) 

Not implemented.

Deprecated:

Reimplemented from Database.

Definition at line 1553 of file DatabaseIbm_db2.php.

References wfDebug().

DatabaseIbm_db2::setup_database (  ) 

Create tables, stored procedures, and so on.

Definition at line 699 of file DatabaseIbm_db2.php.

References $res, applySchema(), begin(), commit(), dbsource(), and print.

DatabaseIbm_db2::strencode ( s  ) 

Alias for addQuotes().

Parameters:
string s string to escape
Returns:
escaped string

Reimplemented from Database.

Definition at line 804 of file DatabaseIbm_db2.php.

References $s.

Referenced by addQuotes(), and addQuotesSmart().

DatabaseIbm_db2::strictIPs (  ) 

Returns true if this database is strict about what can be put into an IP field.

Specifically, it uses a NULL value instead of an empty string.

Reimplemented from Database.

Definition at line 327 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::tableExists ( table  ) 

Queries whether a given table exists.

Returns:
boolean

Reimplemented from Database.

Definition at line 620 of file DatabaseIbm_db2.php.

References $count, $res, $row, $sql, fetchRow(), and Database::query().

DatabaseIbm_db2::tableName ( name  ) 

Handle reserved keyword replacement in table names.

Returns:
Parameters:
$name Object

Reimplemented from Database.

Definition at line 1027 of file DatabaseIbm_db2.php.

References $name.

Referenced by delete(), deleteJoin(), fieldExists(), indexInfo(), indexUnique(), insert(), replace(), textFieldSize(), and update().

DatabaseIbm_db2::textFieldSize ( table,
field 
)

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

Parameters:
string $table table name
string $field column name
Returns:
int length or -1 for unlimited

Reimplemented from Database.

Definition at line 1696 of file DatabaseIbm_db2.php.

References $res, $row, $size, $sql, fetchObject(), freeResult(), Database::query(), and tableName().

DatabaseIbm_db2::timestamp ( ts = 0  ) 

Generates a timestamp in an insertable format.

Returns:
string timestamp value
Parameters:
timestamp $ts

Reimplemented from Database.

Definition at line 1044 of file DatabaseIbm_db2.php.

References $ts, and wfTimestamp().

DatabaseIbm_db2::unlock ( lockName,
method 
)

Not implemented TODO.

Returns:
bool true

Reimplemented from Database.

Definition at line 1565 of file DatabaseIbm_db2.php.

References wfDebug().

DatabaseIbm_db2::update ( table,
values,
conds,
fname = 'Database::update',
options = array() 
)

UPDATE wrapper, takes a condition array and a SET array.

Parameters:
string $table The table to UPDATE
array $values An array of values to SET
array $conds An array of conditions (WHERE). Use '*' to update all rows.
string $fname The Class::Function calling this function (for the log)
array $options An array of UPDATE options, can be one or more of IGNORE, LOW_PRIORITY
Returns:
bool

Reimplemented from Database.

Definition at line 1199 of file DatabaseIbm_db2.php.

References $conds, $fname, $options, $sql, makeListSmart(), Database::makeUpdateOptions(), Database::query(), and tableName().

DatabaseIbm_db2::useIndexClause ( index  ) 

USE INDEX clause DB2 doesn't have them and returns "".

Parameters:
sting $index

Reimplemented from Database.

Definition at line 1245 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::wasDeadlock (  ) 

Did the last database access fail because of deadlock?

Returns:
bool

Reimplemented from Database.

Definition at line 1507 of file DatabaseIbm_db2.php.

References lastErrno(), and wfDebug().


Member Data Documentation

DatabaseIbm_db2::$mAffectedRows = NULL [protected]

Number of rows affected by last INSERT/UPDATE/DELETE.

Definition at line 135 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::$mCataloged = NULL [protected]

Whether connection is cataloged.

Definition at line 127 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::$mInsertId = NULL [protected]

Last sequence value used for a primary key.

Definition at line 145 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::$mLastResult = NULL [protected]

Result of last query.

Definition at line 133 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::$mNumRows = NULL [protected]

Number of rows returned by last SELECT.

Definition at line 137 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::$mPort = NULL [protected]

Server port for uncataloged connections.

Definition at line 125 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::$mSchema = NULL [protected]

Schema for tables, stored procedures, triggers.

Definition at line 129 of file DatabaseIbm_db2.php.

DatabaseIbm_db2::$mSchemaSet = false [protected]

Whether the schema has been applied in this session.

Definition at line 131 of file DatabaseIbm_db2.php.

const DatabaseIbm_db2::CATALOGED = "cataloged"

Definition at line 140 of file DatabaseIbm_db2.php.

const DatabaseIbm_db2::UNCATALOGED = "uncataloged"

Definition at line 141 of file DatabaseIbm_db2.php.

const DatabaseIbm_db2::USE_GLOBAL = "get from global"

Definition at line 142 of file DatabaseIbm_db2.php.


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

Generated on Sat Sep 5 02:08:35 2009 for MediaWiki by  doxygen 1.5.9