* @param array $params Additional parameters include:
* - keywordTableMap : Map of reserved table names to alternative table names to use
*/
- function __construct( array $params ) {
+ public function __construct( array $params ) {
$this->keywordTableMap = $params['keywordTableMap'] ?? [];
$params['tablePrefix'] = strtoupper( $params['tablePrefix'] );
parent::__construct( $params );
"and database)\n" );
}
+ if ( $schema !== null ) {
+ // We use the *database* aspect of $domain for schema, not the domain schema
+ throw new DBExpectedError(
+ $this,
+ __CLASS__ . ": cannot use schema '$schema'; " .
+ "the database component '$dbName' is actually interpreted as the Oracle schema."
+ );
+ }
+
$this->close();
$this->user = $user;
$this->password = $password;
protected function doSelectDomain( DatabaseDomain $domain ) {
if ( $domain->getSchema() !== null ) {
// We use the *database* aspect of $domain for schema, not the domain schema
- throw new DBExpectedError( $this, __CLASS__ . ": domain schemas are not supported." );
+ throw new DBExpectedError(
+ $this,
+ __CLASS__ . ": domain '{$domain->getId()}' has a schema component; " .
+ "the database component is actually interpreted as the Oracle schema."
+ );
}
$database = $domain->getDatabase();
protected function doSelectDomain( DatabaseDomain $domain ) {
if ( $domain->getSchema() !== null ) {
- throw new DBExpectedError( $this, __CLASS__ . ": domain schemas are not supported." );
+ throw new DBExpectedError(
+ $this,
+ __CLASS__ . ": domain '{$domain->getId()}' has a schema component"
+ );
}
$database = $domain->getDatabase();
* - sslCiphers : array list of allowable ciphers [default: null]
* @param array $params
*/
- function __construct( array $params ) {
+ public function __construct( array $params ) {
$this->lagDetectionMethod = $params['lagDetectionMethod'] ?? 'Seconds_Behind_Master';
$this->lagDetectionOptions = $params['lagDetectionOptions'] ?? [];
$this->useGTIDs = !empty( $params['useGTIDs' ] );
$this->close();
if ( $schema !== null ) {
- throw new DBExpectedError( $this, __CLASS__ . ": domain schemas are not supported." );
+ throw new DBExpectedError( $this, __CLASS__ . ": cannot use schemas ('$schema')" );
}
$this->server = $server;
protected function doSelectDomain( DatabaseDomain $domain ) {
if ( $domain->getSchema() !== null ) {
- throw new DBExpectedError( $this, __CLASS__ . ": domain schemas are not supported." );
+ throw new DBExpectedError(
+ $this,
+ __CLASS__ . ": domain '{$domain->getId()}' has a schema component"
+ );
}
$database = $domain->getDatabase();
);
}
+ $this->close();
+
$this->server = $server;
$this->user = $user;
$this->password = $password;
}
$this->connectString = $this->makeConnectionString( $connectVars );
- $this->close();
- $this->installErrorHandler();
+ $this->installErrorHandler();
try {
// Use new connections to let LoadBalancer/LBFactory handle reuse
$this->conn = pg_connect( $this->connectString, PGSQL_CONNECT_FORCE_NEW );
$this->restoreErrorHandler();
throw $ex;
}
-
$phpError = $this->restoreErrorHandler();
if ( !$this->conn ) {
// See https://www.postgresql.org/docs/8.3/sql-set.html
throw new DBUnexpectedError(
$this,
- __METHOD__ . ": a transaction is currently active."
+ __METHOD__ . ": a transaction is currently active"
);
}