29use Wikimedia\WaitConditionLoop;
42 private $numericVersion;
45 private $lastResultHandle;
56 $this->port = intval(
$params[
'port'] ??
null );
76 protected function open( $server, $user, $password, $db, $schema, $tablePrefix ) {
77 if ( !function_exists(
'pg_connect' ) ) {
79 "Postgres functions missing, have you compiled PHP with the --with-pgsql\n" .
80 "option? (Note: if you recently installed PHP, you may need to restart your\n" .
81 "webserver and database)"
85 $this->
close( __METHOD__ );
90 'dbname' => ( $db !==
null && $db !==
'' ) ? $db :
'postgres',
92 'password' => $password
94 if ( $server !==
null && $server !==
'' ) {
95 $connectVars[
'host'] = $server;
97 if ( $this->port > 0 ) {
98 $connectVars[
'port'] = $this->port;
101 $connectVars[
'sslmode'] =
'require';
103 $connectString = $this->makeConnectionString( $connectVars );
107 $this->conn = pg_connect( $connectString, PGSQL_CONNECT_FORCE_NEW ) ?:
null;
108 }
catch ( RuntimeException $e ) {
114 if ( !$this->conn ) {
123 'client_encoding' =>
'UTF8',
124 'datestyle' =>
'ISO, YMD',
126 'standard_conforming_strings' =>
'on',
127 'bytea_output' =>
'escape',
128 'client_min_messages' =>
'ERROR'
130 foreach ( $variables as $var => $val ) {
131 $sql =
'SET ' . $this->
platform->addIdentifierQuotes( $var ) .
' = ' . $this->
addQuotes( $val );
132 $query =
new Query( $sql, self::QUERY_NO_RETRY | self::QUERY_CHANGE_TRX,
'SET' );
133 $this->
query( $query, __METHOD__ );
138 }
catch ( RuntimeException $e ) {
149 if ( $database ===
null ) {
153 $domain->
getSchema() ?? $this->currentDomain->getSchema(),
157 } elseif ( $this->
getDBname() !== $database ) {
170 $this->
platform->setCurrentDomain( $domain );
180 private function makeConnectionString( $vars ) {
182 foreach ( $vars as $name => $value ) {
183 $s .=
"$name='" . str_replace( [
"\\",
"'" ], [
"\\\\",
"\\'" ], $value ) .
"' ";
190 return $this->conn ? pg_close( $this->conn ) :
true;
196 $sql = mb_convert_encoding( $sql,
'UTF-8' );
198 while ( $priorRes = pg_get_result(
$conn ) ) {
199 pg_free_result( $priorRes );
202 if ( pg_send_query(
$conn, $sql ) ===
false ) {
203 throw new DBUnexpectedError( $this,
"Unable to post new query to PostgreSQL\n" );
208 $pgRes = pg_get_result(
$conn );
211 $this->lastResultHandle = $pgRes;
212 $res = pg_result_error( $pgRes ) ? false : $pgRes;
214 return new QueryStatus(
216 is_bool( $res ) ? $res : new PostgresResultWrapper( $this,
$conn, $res ),
217 $pgRes ? pg_affected_rows( $pgRes ) : 0,
227 PGSQL_DIAG_MESSAGE_PRIMARY,
228 PGSQL_DIAG_MESSAGE_DETAIL,
229 PGSQL_DIAG_MESSAGE_HINT,
230 PGSQL_DIAG_STATEMENT_POSITION,
231 PGSQL_DIAG_INTERNAL_POSITION,
232 PGSQL_DIAG_INTERNAL_QUERY,
234 PGSQL_DIAG_SOURCE_FILE,
235 PGSQL_DIAG_SOURCE_LINE,
236 PGSQL_DIAG_SOURCE_FUNCTION
238 foreach ( $diags as $d ) {
239 $this->logger->debug( sprintf(
"PgSQL ERROR(%d): %s",
241 $d, pg_result_error_field( $this->lastResultHandle, $d ) ) );
250 $qs = $this->doSingleStatementQuery(
"SELECT lastval() AS id" );
252 return $qs->res ? (int)$qs->res->fetchRow()[
'id'] : 0;
257 if ( $this->lastResultHandle ) {
259 return pg_result_error( $this->lastResultHandle );
261 return pg_last_error() ?: $this->lastConnectError;
265 return $this->getLastPHPError() ?:
'No database connection';
269 if ( $this->lastResultHandle ) {
271 $lastErrno = pg_result_error_field( $this->lastResultHandle, PGSQL_DIAG_SQLSTATE );
272 if ( $lastErrno !==
false ) {
281 $fname = __METHOD__, $options = [], $join_conds = []
283 $conds = $this->platform->normalizeConditions( $conds, $fname );
284 $column = $this->platform->extractSingleFieldFromList( $var );
285 if ( is_string( $column ) && !in_array( $column, [
'*',
'1' ] ) ) {
286 $conds[] =
"$column IS NOT NULL";
289 $options[
'EXPLAIN'] =
true;
290 $res = $this->select( $table, $var, $conds, $fname, $options, $join_conds );
293 $row = $res->fetchRow();
295 if ( preg_match(
'/rows=(\d+)/', $row[0], $count ) ) {
296 $rows = (int)$count[1];
303 public function indexInfo( $table, $index, $fname = __METHOD__ ) {
304 $components = $this->platform->qualifiedTableComponents( $table );
305 $encTable = $this->addQuotes( end( $components ) );
306 $encIndex = $this->addQuotes( $this->platform->indexName( $index ) );
308 "SELECT indexname,indexdef FROM pg_indexes " .
309 "WHERE tablename=$encTable AND indexname=$encIndex",
310 self::QUERY_IGNORE_DBO_TRX | self::QUERY_CHANGE_NONE,
313 $res = $this->query( $query );
314 $row = $res->fetchObject();
317 return [
'unique' => ( strpos( $row->indexdef,
'CREATE UNIQUE ' ) === 0 ) ];
324 if ( $schema ===
false ) {
325 $schemas = $this->getCoreSchemas();
327 $schemas = [ $schema ];
330 $eindex = $this->addQuotes( $index );
332 $flags = self::QUERY_IGNORE_DBO_TRX | self::QUERY_CHANGE_NONE;
333 foreach ( $schemas as $schema ) {
334 $eschema = $this->addQuotes( $schema );
339 $sql = <<<__INDEXATTR__
343 i.indoption[s.g] as option,
346 (SELECT generate_series(array_lower(isub.indkey,1), array_upper(isub.indkey,1)) AS g
350 ON cis.oid=isub.indexrelid
352 ON cis.relnamespace = ns.oid
353 WHERE cis.relname=$eindex AND ns.nspname=$eschema) AS s,
359 ON ci.oid=i.indexrelid
361 ON ct.oid = i.indrelid
363 ON ci.relnamespace = n.oid
365 ci.relname=$eindex AND n.nspname=$eschema
366 AND attrelid = ct.oid
367 AND i.indkey[s.g] = attnum
368 AND i.indclass[s.g] = opcls.oid
369 AND pg_am.oid = opcls.opcmethod
371 $query =
new Query( $sql, $flags,
'SELECT' );
372 $res = $this->query( $query, __METHOD__ );
375 foreach ( $res as $row ) {
394 array $insertOptions,
395 array $selectOptions,
398 if ( in_array(
'IGNORE', $insertOptions ) ) {
400 $destTableEnc = $this->tableName( $destTable );
402 $selectSql = $this->selectSQLText(
404 array_values( $varMap ),
411 $sql =
"INSERT INTO $destTableEnc (" . implode(
',', array_keys( $varMap ) ) .
') ' .
412 $selectSql .
' ON CONFLICT DO NOTHING';
413 $query =
new Query( $sql, self::QUERY_CHANGE_ROWS,
'INSERT', $destTable );
414 $this->query( $query, $fname );
416 parent::doInsertSelectNative( $destTable, $srcTable, $varMap, $conds, $fname,
417 $insertOptions, $selectOptions, $selectJoinConds );
424 $flags = self::QUERY_IGNORE_DBO_TRX | self::QUERY_CHANGE_NONE;
425 $encTable = $this->addQuotes( $table );
426 foreach ( $this->getCoreSchemas() as $schema ) {
427 $encSchema = $this->addQuotes( $schema );
428 $sql =
"SELECT column_name,udt_name " .
429 "FROM information_schema.columns " .
430 "WHERE table_name = $encTable AND table_schema = $encSchema";
431 $query =
new Query( $sql, $flags,
'SELECT' );
432 $res = $this->query( $query, __METHOD__ );
433 if ( $res->numRows() ) {
434 foreach ( $res as $row ) {
435 $typesByColumn[$row->column_name] = $row->udt_name;
441 return $typesByColumn;
446 static $codes = [
'08000',
'08003',
'08006',
'08001',
'08004',
'57P01',
'57P03',
'53300' ];
448 return in_array( $errno, $codes,
true );
453 return ( $errno ===
'57014' );
461 $oldName, $newName, $temporary =
false, $fname = __METHOD__
463 $newNameE = $this->platform->addIdentifierQuotes( $newName );
464 $oldNameE = $this->platform->addIdentifierQuotes( $oldName );
466 $temporary = $temporary ?
'TEMPORARY' :
'';
468 "CREATE $temporary TABLE $newNameE " .
469 "(LIKE $oldNameE INCLUDING DEFAULTS INCLUDING INDEXES)",
470 self::QUERY_PSEUDO_PERMANENT | self::QUERY_CHANGE_SCHEMA,
471 $temporary ?
'CREATE TEMPORARY' :
'CREATE',
475 $ret = $this->query( $query, $fname );
480 $sql =
'SELECT attname FROM pg_class c'
481 .
' JOIN pg_namespace n ON (n.oid = c.relnamespace)'
482 .
' JOIN pg_attribute a ON (a.attrelid = c.oid)'
483 .
' JOIN pg_attrdef d ON (c.oid=d.adrelid and a.attnum=d.adnum)'
484 .
' WHERE relkind = \'r\''
485 .
' AND nspname = ' . $this->addQuotes( $this->getCoreSchema() )
486 .
' AND relname = ' . $this->addQuotes( $oldName )
487 .
' AND pg_get_expr(adbin, adrelid) LIKE \'nextval(%\'';
490 self::QUERY_IGNORE_DBO_TRX | self::QUERY_CHANGE_NONE,
494 $res = $this->query( $query, $fname );
495 $row = $res->fetchObject();
497 $field = $row->attname;
498 $newSeq =
"{$newName}_{$field}_seq";
499 $fieldE = $this->platform->addIdentifierQuotes( $field );
500 $newSeqE = $this->platform->addIdentifierQuotes( $newSeq );
501 $newSeqQ = $this->addQuotes( $newSeq );
503 "CREATE $temporary SEQUENCE $newSeqE OWNED BY $newNameE.$fieldE",
504 self::QUERY_CHANGE_SCHEMA,
509 $this->query( $query, $fname );
511 "ALTER TABLE $newNameE ALTER COLUMN $fieldE SET DEFAULT nextval({$newSeqQ}::regclass)",
512 self::QUERY_CHANGE_SCHEMA,
517 $this->query( $query, $fname );
524 $sql =
"TRUNCATE TABLE " . $this->tableName( $table ) .
" RESTART IDENTITY";
525 $query =
new Query( $sql, self::QUERY_CHANGE_SCHEMA,
'TRUNCATE', $table );
526 $this->query( $query, $fname );
535 public function listTables( $prefix =
'', $fname = __METHOD__ ) {
536 $eschemas = implode(
',', array_map( [ $this,
'addQuotes' ], $this->getCoreSchemas() ) );
538 "SELECT DISTINCT tablename FROM pg_tables WHERE schemaname IN ($eschemas)",
539 self::QUERY_IGNORE_DBO_TRX | self::QUERY_CHANGE_NONE,
542 $result = $this->query( $query, $fname );
545 foreach ( $result as $table ) {
546 $vars = get_object_vars( $table );
547 $table = array_pop( $vars );
548 if ( $prefix ==
'' || strpos( $table, $prefix ) === 0 ) {
549 $endArray[] = $table;
574 private function pg_array_parse( $text, &$output, $limit =
false, $offset = 1 ) {
575 if ( $limit ===
false ) {
576 $limit = strlen( $text ) - 1;
579 if ( $text ==
'{}' ) {
583 if ( $text[$offset] !=
'{' ) {
584 preg_match(
"/(\\{?\"([^\"\\\\]|\\\\.)*\"|[^,{}]+)+([,}]+)/",
585 $text, $match, 0, $offset );
586 $offset += strlen( $match[0] );
587 $output[] = ( $match[1][0] !=
'"'
589 : stripcslashes( substr( $match[1], 1, -1 ) ) );
590 if ( $match[3] ==
'},' ) {
594 $offset = $this->pg_array_parse( $text, $output, $limit, $offset + 1 );
596 }
while ( $limit > $offset );
602 return '[{{int:version-db-postgres-url}} PostgreSQL]';
614 "SELECT current_schema()",
615 self::QUERY_IGNORE_DBO_TRX | self::QUERY_CHANGE_NONE,
618 $res = $this->query( $query, __METHOD__ );
619 $row = $res->fetchRow();
636 "SELECT current_schemas(false)",
637 self::QUERY_IGNORE_DBO_TRX | self::QUERY_CHANGE_NONE,
640 $res = $this->query( $query, __METHOD__ );
641 $row = $res->fetchRow();
646 return $this->pg_array_parse( $row[0], $schemas );
661 self::QUERY_IGNORE_DBO_TRX | self::QUERY_CHANGE_NONE,
664 $res = $this->query( $query, __METHOD__ );
665 $row = $res->fetchRow();
669 return explode(
",", $row[0] );
679 private function setSearchPath( $search_path ) {
681 "SET search_path = " . implode(
", ", $search_path ),
682 self::QUERY_CHANGE_TRX,
685 $this->query( $query, __METHOD__ );
703 if ( $this->trxLevel() ) {
708 __METHOD__ .
": a transaction is currently active"
712 if ( $this->schemaExists( $desiredSchema ) ) {
713 if ( in_array( $desiredSchema, $this->getSchemas() ) ) {
714 $this->platform->setCoreSchema( $desiredSchema );
715 $this->logger->debug(
716 "Schema \"" . $desiredSchema .
"\" already in the search path\n" );
719 $search_path = $this->getSearchPath();
720 array_unshift( $search_path, $this->platform->addIdentifierQuotes( $desiredSchema ) );
721 $this->setSearchPath( $search_path );
722 $this->platform->setCoreSchema( $desiredSchema );
723 $this->logger->debug(
724 "Schema \"" . $desiredSchema .
"\" added to the search path\n" );
727 $this->platform->setCoreSchema( $this->getCurrentSchema() );
728 $this->logger->debug(
729 "Schema \"" . $desiredSchema .
"\" not found, using current \"" .
730 $this->getCoreSchema() .
"\"\n" );
741 return $this->platform->getCoreSchema();
751 if ( $this->tempSchema ) {
752 return [ $this->tempSchema, $this->getCoreSchema() ];
755 "SELECT nspname FROM pg_catalog.pg_namespace n WHERE n.oid = pg_my_temp_schema()",
756 self::QUERY_IGNORE_DBO_TRX | self::QUERY_CHANGE_NONE,
759 $res = $this->query( $query, __METHOD__ );
760 $row = $res->fetchObject();
762 $this->tempSchema = $row->nspname;
763 return [ $this->tempSchema, $this->getCoreSchema() ];
766 return [ $this->getCoreSchema() ];
770 if ( !isset( $this->numericVersion ) ) {
772 $this->numericVersion = pg_version( $this->getBindingHandle() )[
'server'];
775 return $this->numericVersion;
785 private function relationExists( $table, $types ) {
786 if ( !is_array( $types ) ) {
789 $schemas = $this->getCoreSchemas();
790 $components = $this->platform->qualifiedTableComponents( $table );
791 $etable = $this->addQuotes( end( $components ) );
792 foreach ( $schemas as $schema ) {
793 $eschema = $this->addQuotes( $schema );
794 $sql =
"SELECT 1 FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n "
795 .
"WHERE c.relnamespace = n.oid AND c.relname = $etable AND n.nspname = $eschema "
796 .
"AND c.relkind IN ('" . implode(
"','", $types ) .
"')";
799 self::QUERY_IGNORE_DBO_TRX | self::QUERY_CHANGE_NONE,
802 $res = $this->query( $query, __METHOD__ );
803 if ( $res && $res->numRows() ) {
812 return $this->relationExists( $table, [
'r',
'v' ] );
816 return $this->relationExists( $sequence,
'S' );
820 foreach ( $this->getCoreSchemas() as $schema ) {
821 $sql = sprintf(
"SELECT 1 FROM information_schema.table_constraints " .
822 "WHERE constraint_schema = %s AND table_name = %s AND constraint_name = %s",
823 $this->addQuotes( $schema ),
824 $this->addQuotes( $table ),
825 $this->addQuotes( $constraint )
829 self::QUERY_IGNORE_DBO_TRX | self::QUERY_CHANGE_NONE,
832 $res = $this->query( $query, __METHOD__ );
833 if ( $res && $res->numRows() ) {
846 if ( !strlen( $schema ??
'' ) ) {
850 "SELECT 1 FROM pg_catalog.pg_namespace " .
851 "WHERE nspname = " . $this->addQuotes( $schema ) .
" LIMIT 1",
852 self::QUERY_IGNORE_DBO_TRX | self::QUERY_CHANGE_NONE,
855 $res = $this->query( $query, __METHOD__ );
857 return ( $res->numRows() > 0 );
867 "SELECT 1 FROM pg_catalog.pg_roles " .
868 "WHERE rolname = " . $this->addQuotes( $roleName ) .
" LIMIT 1",
869 self::QUERY_IGNORE_DBO_TRX | self::QUERY_CHANGE_NONE,
872 $res = $this->query( $query, __METHOD__ );
874 return ( $res->numRows() > 0 );
883 return PostgresField::fromText( $this, $table, $field );
887 $conn = $this->getBindingHandle();
889 return new PostgresBlob( pg_escape_bytea( $conn, $b ) );
895 } elseif ( $b instanceof
Blob ) {
899 return pg_unescape_bytea( $b );
904 return pg_escape_string( $this->getBindingHandle(), (
string)$s );
911 $conn = $this->getBindingHandle();
915 } elseif ( is_bool( $s ) ) {
916 return (
string)intval( $s );
917 } elseif ( is_int( $s ) ) {
919 } elseif ( $s instanceof
Blob ) {
923 $s = pg_escape_bytea( $conn, $s->fetch() );
928 return "'" . pg_escape_string( $conn, (
string)$s ) .
"'";
932 # Allow dollar quoting for function declarations
933 if ( str_starts_with( $newLine,
'$mw$' ) ) {
934 if ( $this->delimiter ) {
935 $this->delimiter =
false;
937 $this->delimiter =
';';
941 return parent::streamStatementEnd( $sql, $newLine );
946 $this->platform->lockIsFreeSQLText( $lockName ),
947 self::QUERY_CHANGE_LOCKS,
950 $res = $this->query( $query, $method );
951 $row = $res->fetchObject();
953 return (
bool)$row->unlocked;
956 public function doLock(
string $lockName,
string $method,
int $timeout ) {
958 $this->platform->lockSQLText( $lockName, $timeout ),
959 self::QUERY_CHANGE_LOCKS,
964 $loop =
new WaitConditionLoop(
965 function () use ( $query, $method, &$acquired ) {
966 $res = $this->query( $query, $method );
967 $row = $res->fetchObject();
969 if ( $row->acquired !==
null ) {
970 $acquired = (float)$row->acquired;
972 return WaitConditionLoop::CONDITION_REACHED;
975 return WaitConditionLoop::CONDITION_CONTINUE;
984 public function doUnlock(
string $lockName,
string $method ) {
986 $this->platform->unlockSQLText( $lockName ),
987 self::QUERY_CHANGE_LOCKS,
990 $result = $this->query( $query, $method );
991 $row = $result->fetchObject();
993 return (
bool)$row->released;
997 $flags = self::QUERY_CHANGE_LOCKS | self::QUERY_NO_RETRY;
1000 $sql =
"SELECT pg_advisory_unlock_all()";
1001 $query =
new Query( $sql, $flags,
'UNLOCK' );
1002 $qs = $this->executeQuery( $query, __METHOD__, $flags );
1003 if ( $qs->res ===
false ) {
1004 $this->reportQueryError( $qs->message, $qs->code, $sql, $fname,
true );
1010 "SHOW default_transaction_read_only",
1011 self::QUERY_IGNORE_DBO_TRX | self::QUERY_CHANGE_NONE,
1014 $res = $this->query( $query, __METHOD__ );
1015 $row = $res->fetchObject();
1017 return $row && strtolower( $row->default_transaction_read_only ) ===
'on';
1023 $flags = self::QUERY_IGNORE_DBO_TRX | self::QUERY_CHANGE_NONE;
1024 $components = $this->platform->qualifiedTableComponents( $table );
1025 $encTable = $this->addQuotes( end( $components ) );
1026 foreach ( $this->getCoreSchemas() as $schema ) {
1027 $encSchema = $this->addQuotes( $schema );
1029 "SELECT column_name,data_type,column_default " .
1030 "FROM information_schema.columns " .
1031 "WHERE table_name = $encTable AND table_schema = $encSchema",
1032 self::QUERY_IGNORE_DBO_TRX | self::QUERY_CHANGE_NONE,
1035 $res = $this->query( $query, __METHOD__ );
1036 if ( $res->numRows() ) {
1037 foreach ( $res as $row ) {
1039 $row->column_default !==
null &&
1040 str_starts_with( $row->column_default,
"nextval(" ) &&
1041 in_array( $row->data_type, [
'integer',
'bigint' ],
true )
1043 $column = $row->column_name;
1054 return [ self::ATTR_SCHEMAS_AS_TABLE_GROUPS => true ];
array $params
The job parameters.
Class to handle database/schema/prefix specifications for IDatabase.
Postgres database abstraction layer.
truncateTable( $table, $fname=__METHOD__)
Delete all data in a table and reset any sequences owned by that table.
getCoreSchemas()
Return schema names for temporary tables and core application tables.
determineCoreSchema( $desiredSchema)
Determine default schema for the current application Adjust this session schema search path if desire...
duplicateTableStructure( $oldName, $newName, $temporary=false, $fname=__METHOD__)
Creates a new table with structure copied from existing table.
isQueryTimeoutError( $errno)
Checks whether the cause of the error is detected to be a timeout.
fieldInfo( $table, $field)
doLock(string $lockName, string $method, int $timeout)
isKnownStatementRollbackError( $errno)
indexAttributes( $index, $schema=false)
PostgresPlatform $platform
databasesAreIndependent()
Returns true if DBs are assumed to be on potentially different servers.
doUnlock(string $lockName, string $method)
doSingleStatementQuery(string $sql)
Run a query and return a QueryStatus instance with the query result information.
streamStatementEnd(&$sql, &$newLine)
Called by sourceStream() to check if we've reached a statement end.
doLockIsFree(string $lockName, string $method)
doSelectDomain(DatabaseDomain $domain)
roleExists( $roleName)
Returns true if a given role (i.e.
getSchemas()
Return list of schemas which are accessible without schema name This is list does not contain magic k...
indexInfo( $table, $index, $fname=__METHOD__)
Get information about an index into an object.
schemaExists( $schema)
Query whether a given schema exists.
estimateRowCount( $table, $var=' *', $conds='', $fname=__METHOD__, $options=[], $join_conds=[])
Estimate the number of rows in dataset.MySQL allows you to estimate the number of rows that would be ...
getInsertIdColumnForUpsert( $table)
lastError()
Get the RDBMS-specific error description from the last attempted query statement.
addQuotes( $s)
Escape and quote a raw value string for use in a SQL query.
__construct(array $params)
tableExists( $table, $fname=__METHOD__)
Query whether a given table exists.
lastErrno()
Get the RDBMS-specific error code from the last attempted query statement.
getCoreSchema()
Return schema name for core application tables.
strencode( $s)
Wrapper for addslashes()
lastInsertId()
Get a row ID from the last insert statement to implicitly assign one within the session.
isConnectionError( $errno)
Do not use this method outside of Database/DBError classes.
sequenceExists( $sequence)
open( $server, $user, $password, $db, $schema, $tablePrefix)
Open a new connection to the database (closing any existing one)
getServerVersion()
A string describing the current software version.
getCurrentSchema()
Return current schema (executes SELECT current_schema()) Needs transaction.
getSearchPath()
Return search patch for schemas This is different from getSchemas() since it contain magic keywords (...
decodeBlob( $b)
Some DBMSs return a special placeholder object representing blob fields in result objects.
encodeBlob( $b)
Some DBMSs have a special format for inserting into blob fields, they don't allow simple quoted strin...
closeConnection()
Closes underlying database connection.
getValueTypesForWithClause( $table)
constraintExists( $table, $constraint)
getType()
Get the RDBMS type of the server (e.g.
doFlushSession( $fname)
Reset the server-side session state for named locks and table locks.
listTables( $prefix='', $fname=__METHOD__)
getSoftwareLink()
Returns a wikitext style link to the DB's website (e.g.
doInsertSelectNative( $destTable, $srcTable, array $varMap, $conds, $fname, array $insertOptions, array $selectOptions, $selectJoinConds)
Native server-side implementation of insertSelect() for situations where we don't want to select ever...
serverIsReadOnly()
bool Whether this DB server is running in server-side read-only mode query} 1.28