Inherits Database.
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 () |
Definition at line 105 of file DatabaseIbm_db2.php.
DatabaseIbm_db2::addQuotes | ( | $ | s | ) |
Escapes strings Doesn't escape numbers.
string | s string to escape |
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.
string | s string to escape |
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.
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.
array | $stringList strings that need to be joined together by the SQL engine |
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().
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
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 |
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 | |||
) |
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.
Object | $res result set | |
int | $row row number |
Reimplemented from Database.
Definition at line 1330 of file DatabaseIbm_db2.php.
DatabaseIbm_db2::decodeBlob | ( | $ | b | ) |
Description is left as an exercise for the reader.
IBM_DB2Blob | $b data to be decoded |
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.
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().
$sql | String: SQL query. |
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.
mixed | $b data to be encoded |
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().
string | $table table name | |
array | $vars unused | |
array | $conds filters on the table | |
string | $fname function name for profiling | |
array | $options options for select |
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.
string | $column name of timestamp column |
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.
$res | SQL result object as returned from Database::query(), etc. |
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'].
$res | SQL result object as returned from Database::query(), etc. |
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.
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.
string | $table table name | |
string | $field column name |
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.
Object | $res Statement resource | |
int | $n Index of field or column |
Reimplemented from Database.
Definition at line 1373 of file DatabaseIbm_db2.php.
DatabaseIbm_db2::fieldType | ( | $ | res, | |
$ | index | |||
) |
db2_field_type() wrapper
Object | $res Result of executed statement | |
mixed | $index number or name of the column |
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.
Object | $res Statement resource to free |
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.
Reimplemented from Database.
Definition at line 1496 of file DatabaseIbm_db2.php.
DatabaseIbm_db2::getServerVersion | ( | ) |
Reimplemented from Database.
Definition at line 611 of file DatabaseIbm_db2.php.
DatabaseIbm_db2::getSoftwareLink | ( | ) |
Returns link to IBM DB2 free download.
Reimplemented from Database.
Definition at line 1461 of file DatabaseIbm_db2.php.
DatabaseIbm_db2::getStatus | ( | $ | which | ) |
Not implemented.
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.
string | $table table name | |
string | $index index name | |
string |
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.
string | $table table name | |
string | $index index name | |
string | $fnam function name for profiling |
Definition at line 1671 of file DatabaseIbm_db2.php.
References $fname, $res, $sql, fetchObject(), Database::query(), and tableName().
DatabaseIbm_db2::initial_setup | ( | ) |
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
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 |
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.
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.
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?
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.
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] |
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.
DatabaseIbm_db2::limitResultForUpdate | ( | $ | sql, | |
$ | num | |||
) |
Not implemented.
Reimplemented from Database.
Definition at line 1581 of file DatabaseIbm_db2.php.
References $sql.
DatabaseIbm_db2::lock | ( | $ | lockName, | |
$ | method | |||
) |
Not implemented TODO.
Reimplemented from Database.
Definition at line 1559 of file DatabaseIbm_db2.php.
References wfDebug().
DatabaseIbm_db2::lowPriorityOption | ( | ) |
No such option.
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.
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().
DatabaseIbm_db2::makeSelectOptions | ( | $ | options | ) |
Handles ordering, grouping, and having options ('GROUP BY' => colname) Has limited support for per-column options (colnum => 'DISTINCT').
array | $options an associative array of options to be turned into an SQL query, valid keys are listed in the function. |
Reimplemented from Database.
Definition at line 1437 of file DatabaseIbm_db2.php.
static DatabaseIbm_db2::newFromParams | ( | $ | server, | |
$ | user, | |||
$ | password, | |||
$ | dbName, | |||
$ | failFunction = false , |
|||
$ | flags = 0 | |||
) | [static] |
Returns a fresh instance of this class.
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().
string | seqName Name of a defined sequence in the database |
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.
Object | $res Statement 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.
Object | $res result set |
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.
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] |
DatabaseIbm_db2::openUncataloged | ( | $ | dbName, | |
$ | user, | |||
$ | password, | |||
$ | server, | |||
$ | port | |||
) | [protected] |
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.
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.
$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 |
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.
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') ) |
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.
object | $db |
Reimplemented from Database.
Definition at line 1470 of file DatabaseIbm_db2.php.
DatabaseIbm_db2::setFakeMaster | ( | $ | enabled | ) |
Not implemented.
Reimplemented from Database.
Definition at line 1575 of file DatabaseIbm_db2.php.
References wfDebug().
DatabaseIbm_db2::setFakeSlaveLag | ( | $ | lag | ) |
Not implemented.
Reimplemented from Database.
Definition at line 1570 of file DatabaseIbm_db2.php.
References wfDebug().
DatabaseIbm_db2::setTimeout | ( | $ | timeout | ) |
Not implemented.
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().
string | s string to escape |
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.
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.
$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".
string | $table table name | |
string | $field column name |
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.
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.
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.
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 |
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 "".
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?
Reimplemented from Database.
Definition at line 1507 of file DatabaseIbm_db2.php.
References lastErrno(), and wfDebug().
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] |
DatabaseIbm_db2::$mInsertId = NULL [protected] |
DatabaseIbm_db2::$mLastResult = NULL [protected] |
DatabaseIbm_db2::$mNumRows = NULL [protected] |
DatabaseIbm_db2::$mPort = NULL [protected] |
DatabaseIbm_db2::$mSchema = NULL [protected] |
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.