Unverified Commit 7811e4ee authored by Sergei Morozov's avatar Sergei Morozov

Merge branch '3.0.x'

parents 01143c9c 40cc9bd5
...@@ -30,22 +30,6 @@ The statement implementations no longer detect whether `$params` is a zero- or o ...@@ -30,22 +30,6 @@ The statement implementations no longer detect whether `$params` is a zero- or o
The `ServerInfoAwareConnection::requiresQueryForServerVersion()` method has been removed as an implementation detail which is the same for almost all supported drivers. The `ServerInfoAwareConnection::requiresQueryForServerVersion()` method has been removed as an implementation detail which is the same for almost all supported drivers.
## BC BREAK: Removed support for PostgreSQL 9.3 and older
DBAL now requires PostgeSQL 9.4 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to newer PostgreSQL version (9.6+ is recommended).
`Doctrine\DBAL\Platforms\PostgreSqlPlatform` and `Doctrine\DBAL\Platforms\Keywords\PostgreSQLKeywords` now represent the PostgreSQL 9.4.
The following classes have been removed:
* `Doctrine\DBAL\Platforms\PostgreSQL94Platform`
* `Doctrine\DBAL\Platforms\Keywords\PostgreSQL94Keywords`
## BC BREAK: Removed support for MariaDB 10.0 and older
DBAL now requires MariaDB 10.1 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to newer MariaDB version (10.1+ is recommended).
## BC BREAK: Changes in obtaining the currently selected database name ## BC BREAK: Changes in obtaining the currently selected database name
- The `Doctrine\DBAL\Driver::getDatabase()` method has been removed. Please use `Doctrine\DBAL\Connection::getDatabase()` instead. - The `Doctrine\DBAL\Driver::getDatabase()` method has been removed. Please use `Doctrine\DBAL\Connection::getDatabase()` instead.
...@@ -266,94 +250,94 @@ The `NULL` value of the `$offset` argument in `AbstractPlatform::(do)?ModifyLimi ...@@ -266,94 +250,94 @@ The `NULL` value of the `$offset` argument in `AbstractPlatform::(do)?ModifyLimi
The support for DB-generated UUIDs was removed as non-portable. The support for DB-generated UUIDs was removed as non-portable.
Please generate UUIDs on the application side (e.g. using [ramsey/uuid](https://packagist.org/packages/ramsey/uuid)). Please generate UUIDs on the application side (e.g. using [ramsey/uuid](https://packagist.org/packages/ramsey/uuid)).
## BC BREAK: Removed MsSQLKeywords class ## BC BREAK: Removed Doctrine\DBAL\Version
The `Doctrine\DBAL\Platforms\MsSQLKeywords` has been removed. The Doctrine\DBAL\Version class is no longer available: please refrain from checking the DBAL version at runtime.
Please use `Doctrine\DBAL\Platforms\SQLServerPlatform `instead.
## BC BREAK: Removed PDO DB2 driver ## BC BREAK: SQLLogger changes
This PDO-based IBM DB2 driver (built on top of pdo_ibm extension) has already been unsupported as of 2.5, it has now been now removed. - The `SQLLogger` interface has changed; the methods are the same but use scalar type hints, return types, and non-nullable arrays.
- `SQLLogger` implementations: `DebugStack`, `EchoSQLLogger`, `LoggerChain` are now final.
- `Configuration::getSQLLogger()` does not return `null` anymore, but a `NullLogger` implementation.
- `Configuration::setSQLLogger()` does not allow `null` anymore.
The following class has been removed: ## BC BREAK: Changes to handling binary fields
* `Doctrine\DBAL\Driver\PDOIbm\Driver` - Binary fields whose length exceeds the maximum field size on a given platform are no longer represented as `BLOB`s.
Use binary fields of a size which fits all target platforms, or use blob explicitly instead.
- Binary fields are no longer represented as streams in PHP. They are represented as strings.
# Upgrade to 3.0
## BC BREAK: Removed support for SQL Anywhere 12 and older ## BC BREAK: Removed support for SQL Anywhere 12 and older
DBAL now requires SQL Anywhere 16 or newer, support for unmaintained versions has been dropped. DBAL now requires SQL Anywhere 16 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to newer SQL Anywhere version (16+). If you are using any of the legacy versions, you have to upgrade to a newer SQL Anywhere version (16+).
`Doctrine\DBAL\Platforms\SQLAnywherePlatform` and `Doctrine\DBAL\Platforms\Keywords\SQLAnywhereKeywords` now represent the SQL Anywhere 16.
The following classes have been removed: The following classes have been removed:
* `Doctrine\DBAL\Platforms\SQLAnywherePlatform`
* `Doctrine\DBAL\Platforms\SQLAnywhere11Platform` * `Doctrine\DBAL\Platforms\SQLAnywhere11Platform`
* `Doctrine\DBAL\Platforms\SQLAnywhere12Platform` * `Doctrine\DBAL\Platforms\SQLAnywhere12Platform`
* `Doctrine\DBAL\Platforms\SQLAnywhere16Platform` * `Doctrine\DBAL\Platforms\Keywords\SQLAnywhereKeywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLAnywhere11Keywords` * `Doctrine\DBAL\Platforms\Keywords\SQLAnywhere11Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLAnywhere12Keywords` * `Doctrine\DBAL\Platforms\Keywords\SQLAnywhere12Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLAnywhere16Keywords`
## BC BREAK: Removed support for SQL Server 2008 and older
DBAL now requires SQL Server 2012 or newer, support for unmaintained versions has been dropped. ## BC BREAK: Removed support for PostgreSQL 9.3 and older
If you are using any of the legacy versions, you have to upgrade to newer SQL Server version.
`Doctrine\DBAL\Platforms\SQLServerPlatform` and `Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords` now represent the SQL Server 2012.
The following classes have been removed:
* `Doctrine\DBAL\Platforms\SQLServer2005Platform`
* `Doctrine\DBAL\Platforms\SQLServer2008Platform`
* `Doctrine\DBAL\Platforms\SQLServer2012Platform`
* `Doctrine\DBAL\Platforms\Keywords\SQLServer2005Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLServer2008Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLServer2012Keywords`
The `AbstractSQLServerDriver` class and its subclasses no longer implement the `VersionAwarePlatformDriver` interface.
## BC BREAK: Removed support for PostgreSQL 9.2 and older
DBAL now requires PostgeSQL 9.3 or newer, support for unmaintained versions has been dropped. DBAL now requires PostgreSQL 9.4 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to newer PostgreSQL version (9.6+ is recommended). If you are using any of the legacy versions, you have to upgrade to a newer PostgreSQL version (9.6+ is recommended).
`Doctrine\DBAL\Platforms\PostgreSqlPlatform` and `Doctrine\DBAL\Platforms\Keywords\PostgreSQLKeywords` now represent the PostgreSQL 9.3.
The following classes have been removed: The following classes have been removed:
* `Doctrine\DBAL\Platforms\PostgreSqlPlatform`
* `Doctrine\DBAL\Platforms\PostgreSQL91Platform` * `Doctrine\DBAL\Platforms\PostgreSQL91Platform`
* `Doctrine\DBAL\Platforms\PostgreSQL92Platform` * `Doctrine\DBAL\Platforms\PostgreSQL92Platform`
* `Doctrine\DBAL\Platforms\Keywords\PostgreSQLKeywords`
* `Doctrine\DBAL\Platforms\Keywords\PostgreSQL91Keywords` * `Doctrine\DBAL\Platforms\Keywords\PostgreSQL91Keywords`
* `Doctrine\DBAL\Platforms\Keywords\PostgreSQL92Keywords` * `Doctrine\DBAL\Platforms\Keywords\PostgreSQL92Keywords`
## BC BREAK: Removed Doctrine\DBAL\Version ## BC BREAK: Removed support for MariaDB 10.0 and older
The Doctrine\DBAL\Version class is no longer available: please refrain from checking the DBAL version at runtime. DBAL now requires MariaDB 10.1 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to a newer MariaDB version (10.1+ is recommended).
## BC BREAK: Removed Drizzle support ## BC BREAK: PingableConnection and ServerInfoAwareConnection interfaces now extend Connection
The Drizzle project is abandoned and is therefore not supported by Doctrine DBAL anymore. All implementations of the `PingableConnection` and `ServerInfoAwareConnection` interfaces have to implement the methods defined in the `Connection` interface as well.
## BC BREAK: SQLLogger changes ## BC BREAK: VersionAwarePlatformDriver interface now extends Driver
- The `SQLLogger` interface has changed; the methods are the same but use scalar type hints, return types, and non-nullable arrays. All implementations of the `VersionAwarePlatformDriver` interface have to implement the methods defined in the `Driver` interface as well.
- `SQLLogger` implementations: `DebugStack`, `EchoSQLLogger`, `LoggerChain` are now final.
- `Configuration::getSQLLogger()` does not return `null` anymore, but a `NullLogger` implementation.
- `Configuration::setSQLLogger()` does not allow `null` anymore.
## BC BREAK: Changes to handling binary fields ## BC BREAK: Removed MsSQLKeywords class
- Binary fields whose length exceeds the maximum field size on a given platform are no longer represented as `BLOB`s. The `Doctrine\DBAL\Platforms\MsSQLKeywords` class has been removed.
Use binary fields of a size which fits all target platforms, or use blob explicitly instead. Please use `Doctrine\DBAL\Platforms\SQLServerPlatform `instead.
- Binary fields are no longer represented as streams in PHP. They are represented as strings.
# Upgrade to 3.0 ## BC BREAK: Removed PDO DB2 driver
## BC BREAK: PingableConnection and ServerInfoAwareConnection interfaces now extend Connection This PDO-based IBM DB2 driver (built on top of `pdo_ibm` extension) has already been unsupported as of 2.5, it has been now removed.
All implementations of the `PingableConnection` and `ServerInfoAwareConnection` interfaces have to implement the methods defined in the `Connection` interface as well. The following class has been removed:
## BC BREAK: VersionAwarePlatformDriver interface now extends Driver * `Doctrine\DBAL\Driver\PDOIbm\Driver`
All implementations of the `VersionAwarePlatformDriver` interface have to implement the methods defined in the `Driver` interface as well. ## BC BREAK: Removed support for SQL Server 2008 and older
DBAL now requires SQL Server 2012 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to a newer SQL Server version.
The following classes have been removed:
* `Doctrine\DBAL\Platforms\SQLServerPlatform`
* `Doctrine\DBAL\Platforms\SQLServer2005Platform`
* `Doctrine\DBAL\Platforms\SQLServer2008Platform`
* `Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLServer2005Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLServer2008Keywords`
The `AbstractSQLServerDriver` class and its subclasses no longer implement the `VersionAwarePlatformDriver` interface.
## BC BREAK: Removed Doctrine\DBAL\Version ## BC BREAK: Removed Doctrine\DBAL\Version
...@@ -396,6 +380,10 @@ After: ...@@ -396,6 +380,10 @@ After:
$stmt->bindValue(1, 1, ParameterType::INTEGER); $stmt->bindValue(1, 1, ParameterType::INTEGER);
$stmt->fetchAll(FetchMode::COLUMN); $stmt->fetchAll(FetchMode::COLUMN);
## BC BREAK: Removed Drizzle support
The Drizzle project is abandoned and is therefore not supported by Doctrine DBAL anymore.
## BC BREAK: Removed dbal:import CLI command ## BC BREAK: Removed dbal:import CLI command
The `dbal:import` CLI command has been removed since it only worked with PDO-based drivers by relying on a non-documented behavior of the extension, and it was impossible to make it work with other drivers. The `dbal:import` CLI command has been removed since it only worked with PDO-based drivers by relying on a non-documented behavior of the extension, and it was impossible to make it work with other drivers.
...@@ -407,6 +395,24 @@ Please use other database client applications for import, e.g.: ...@@ -407,6 +395,24 @@ Please use other database client applications for import, e.g.:
# Upgrade to 2.11 # Upgrade to 2.11
## Deprecated database platforms:
1. PostgreSQL 9.3 and older
2. MariaDB 10.0 and older
3. SQL Server 2008 and older
4. SQL Anywhere 12 and older
5. Drizzle
6. Azure SQL Database
## Deprecated database drivers:
1. PDO-based IBM DB2 driver
2. Drizzle MySQL driver
## Deprecated `Doctrine\DBAL\Sharding` package
The sharding functionality in DBAL has been effectively unmaintained for a long time.
## Deprecated `Doctrine\DBAL\Version` class ## Deprecated `Doctrine\DBAL\Version` class
The usage of the `Doctrine\DBAL\Version` class is deprecated as internal implementation detail. Please refrain from checking the DBAL version at runtime. The usage of the `Doctrine\DBAL\Version` class is deprecated as internal implementation detail. Please refrain from checking the DBAL version at runtime.
......
...@@ -50,20 +50,17 @@ Oracle ...@@ -50,20 +50,17 @@ Oracle
Microsoft SQL Server Microsoft SQL Server
^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
- ``SQLServerPlatform`` for version 2012 and above. - ``SQLServer2012Platform`` for version 2012 and above.
PostgreSQL PostgreSQL
^^^^^^^^^^ ^^^^^^^^^^
- ``PostgreSqlPlatform`` for version 9.4 and above. - ``PostgreSQL94Platform`` for version 9.4 and above.
- ``PostgreSQL100Platform`` for version 10.0 and above. - ``PostgreSQL100Platform`` for version 10.0 and above.
SAP Sybase SQL Anywhere SAP Sybase SQL Anywhere
^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
- ``SQLAnywherePlatform`` for version 10 and above.
- ``SQLAnywhere11Platform`` for version 11 and above.
- ``SQLAnywhere12Platform`` for version 12 and above.
- ``SQLAnywhere16Platform`` for version 16 and above. - ``SQLAnywhere16Platform`` for version 16 and above.
SQLite SQLite
...@@ -103,4 +100,3 @@ all the different database vendors, for example MySQL BIGINT and ...@@ -103,4 +100,3 @@ all the different database vendors, for example MySQL BIGINT and
Oracle NUMBER should be handled as integer. Doctrine 2 offers a Oracle NUMBER should be handled as integer. Doctrine 2 offers a
powerful way to abstract the database to php and back conversion, powerful way to abstract the database to php and back conversion,
which is described in the next section. which is described in the next section.
...@@ -11,7 +11,7 @@ use Doctrine\DBAL\Exception\DriverException; ...@@ -11,7 +11,7 @@ use Doctrine\DBAL\Exception\DriverException;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\Exception\InvalidPlatformVersion; use Doctrine\DBAL\Platforms\Exception\InvalidPlatformVersion;
use Doctrine\DBAL\Platforms\PostgreSQL100Platform; use Doctrine\DBAL\Platforms\PostgreSQL100Platform;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\PostgreSqlSchemaManager; use Doctrine\DBAL\Schema\PostgreSqlSchemaManager;
use Doctrine\DBAL\VersionAwarePlatformDriver; use Doctrine\DBAL\VersionAwarePlatformDriver;
...@@ -98,12 +98,12 @@ abstract class AbstractPostgreSQLDriver implements ExceptionConverterDriver, Ver ...@@ -98,12 +98,12 @@ abstract class AbstractPostgreSQLDriver implements ExceptionConverterDriver, Ver
return new PostgreSQL100Platform(); return new PostgreSQL100Platform();
} }
return new PostgreSqlPlatform(); return new PostgreSQL94Platform();
} }
public function getDatabasePlatform() : AbstractPlatform public function getDatabasePlatform() : AbstractPlatform
{ {
return new PostgreSqlPlatform(); return new PostgreSQL94Platform();
} }
public function getSchemaManager(Connection $conn) : AbstractSchemaManager public function getSchemaManager(Connection $conn) : AbstractSchemaManager
......
...@@ -10,7 +10,7 @@ use Doctrine\DBAL\Exception; ...@@ -10,7 +10,7 @@ use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Exception\DriverException; use Doctrine\DBAL\Exception\DriverException;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\Exception\InvalidPlatformVersion; use Doctrine\DBAL\Platforms\Exception\InvalidPlatformVersion;
use Doctrine\DBAL\Platforms\SQLAnywherePlatform; use Doctrine\DBAL\Platforms\SQLAnywhere16Platform;
use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\SQLAnywhereSchemaManager; use Doctrine\DBAL\Schema\SQLAnywhereSchemaManager;
use Doctrine\DBAL\VersionAwarePlatformDriver; use Doctrine\DBAL\VersionAwarePlatformDriver;
...@@ -89,12 +89,12 @@ abstract class AbstractSQLAnywhereDriver implements ExceptionConverterDriver, Ve ...@@ -89,12 +89,12 @@ abstract class AbstractSQLAnywhereDriver implements ExceptionConverterDriver, Ve
); );
} }
return new SQLAnywherePlatform(); return new SQLAnywhere16Platform();
} }
public function getDatabasePlatform() : AbstractPlatform public function getDatabasePlatform() : AbstractPlatform
{ {
return new SQLAnywherePlatform(); return new SQLAnywhere16Platform();
} }
public function getSchemaManager(Connection $conn) : AbstractSchemaManager public function getSchemaManager(Connection $conn) : AbstractSchemaManager
......
...@@ -7,7 +7,7 @@ namespace Doctrine\DBAL\Driver; ...@@ -7,7 +7,7 @@ namespace Doctrine\DBAL\Driver;
use Doctrine\DBAL\Connection; use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver; use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\SQLServerPlatform; use Doctrine\DBAL\Platforms\SQLServer2012Platform;
use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\SQLServerSchemaManager; use Doctrine\DBAL\Schema\SQLServerSchemaManager;
...@@ -18,7 +18,7 @@ abstract class AbstractSQLServerDriver implements Driver ...@@ -18,7 +18,7 @@ abstract class AbstractSQLServerDriver implements Driver
{ {
public function getDatabasePlatform() : AbstractPlatform public function getDatabasePlatform() : AbstractPlatform
{ {
return new SQLServerPlatform(); return new SQLServer2012Platform();
} }
public function getSchemaManager(Connection $conn) : AbstractSchemaManager public function getSchemaManager(Connection $conn) : AbstractSchemaManager
......
...@@ -7,7 +7,7 @@ namespace Doctrine\DBAL\Platforms\Keywords; ...@@ -7,7 +7,7 @@ namespace Doctrine\DBAL\Platforms\Keywords;
/** /**
* PostgreSQL 10.0 reserved keywords list. * PostgreSQL 10.0 reserved keywords list.
*/ */
class PostgreSQL100Keywords extends PostgreSQLKeywords class PostgreSQL100Keywords extends PostgreSQL94Keywords
{ {
public function getName() : string public function getName() : string
{ {
......
...@@ -5,13 +5,13 @@ declare(strict_types=1); ...@@ -5,13 +5,13 @@ declare(strict_types=1);
namespace Doctrine\DBAL\Platforms\Keywords; namespace Doctrine\DBAL\Platforms\Keywords;
/** /**
* PostgreSQL keywords list. * PostgreSQL 9.4 reserved keywords list.
*/ */
class PostgreSQLKeywords extends KeywordList class PostgreSQL94Keywords extends KeywordList
{ {
public function getName() : string public function getName() : string
{ {
return 'PostgreSQL'; return 'PostgreSQL94';
} }
/** /**
......
...@@ -5,13 +5,13 @@ declare(strict_types=1); ...@@ -5,13 +5,13 @@ declare(strict_types=1);
namespace Doctrine\DBAL\Platforms\Keywords; namespace Doctrine\DBAL\Platforms\Keywords;
/** /**
* SAP Sybase SQL Anywhere 10 reserved keywords list. * SAP Sybase SQL Anywhere 16 reserved keywords list.
*/ */
class SQLAnywhereKeywords extends KeywordList class SQLAnywhere16Keywords extends KeywordList
{ {
public function getName() : string public function getName() : string
{ {
return 'SQLAnywhere'; return 'SQLAnywhere16';
} }
/** /**
......
...@@ -5,15 +5,13 @@ declare(strict_types=1); ...@@ -5,15 +5,13 @@ declare(strict_types=1);
namespace Doctrine\DBAL\Platforms\Keywords; namespace Doctrine\DBAL\Platforms\Keywords;
/** /**
* Microsoft SQL Server 2000 reserved keyword dictionary. * Microsoft SQL Server 2012 reserved keyword dictionary.
*
* @link www.doctrine-project.com
*/ */
class SQLServerKeywords extends KeywordList class SQLServer2012Keywords extends KeywordList
{ {
public function getName() : string public function getName() : string
{ {
return 'SQLServer'; return 'SQLServer2012';
} }
/** /**
......
...@@ -9,7 +9,7 @@ use Doctrine\DBAL\Platforms\Keywords\PostgreSQL100Keywords; ...@@ -9,7 +9,7 @@ use Doctrine\DBAL\Platforms\Keywords\PostgreSQL100Keywords;
/** /**
* Provides the behavior, features and SQL dialect of the PostgreSQL 10.0 database platform. * Provides the behavior, features and SQL dialect of the PostgreSQL 10.0 database platform.
*/ */
class PostgreSQL100Platform extends PostgreSqlPlatform class PostgreSQL100Platform extends PostgreSQL94Platform
{ {
protected function getReservedKeywordsClass() : string protected function getReservedKeywordsClass() : string
{ {
......
...@@ -36,10 +36,8 @@ use function trim; ...@@ -36,10 +36,8 @@ use function trim;
/** /**
* Provides the behavior, features and SQL dialect of the PostgreSQL 9.4+ database platform. * Provides the behavior, features and SQL dialect of the PostgreSQL 9.4+ database platform.
*
* @todo Rename: PostgreSQLPlatform
*/ */
class PostgreSqlPlatform extends AbstractPlatform class PostgreSQL94Platform extends AbstractPlatform
{ {
/** @var bool */ /** @var bool */
private $useBooleanTrueFalseStrings = true; private $useBooleanTrueFalseStrings = true;
...@@ -1036,7 +1034,7 @@ SQL ...@@ -1036,7 +1034,7 @@ SQL
protected function getReservedKeywordsClass() : string protected function getReservedKeywordsClass() : string
{ {
return Keywords\PostgreSQLKeywords::class; return Keywords\PostgreSQL94Keywords::class;
} }
/** /**
......
...@@ -36,10 +36,9 @@ use function strtoupper; ...@@ -36,10 +36,9 @@ use function strtoupper;
use function substr; use function substr;
/** /**
* The SQLAnywherePlatform provides the behavior, features and SQL dialect of the * Provides the behavior, features and SQL dialect of the SAP Sybase SQL Anywhere 16 database platform.
* SAP Sybase SQL Anywhere 12 database platform.
*/ */
class SQLAnywherePlatform extends AbstractPlatform class SQLAnywhere16Platform extends AbstractPlatform
{ {
public const FOREIGN_KEY_MATCH_SIMPLE = 1; public const FOREIGN_KEY_MATCH_SIMPLE = 1;
public const FOREIGN_KEY_MATCH_FULL = 2; public const FOREIGN_KEY_MATCH_FULL = 2;
...@@ -1310,7 +1309,7 @@ SQL ...@@ -1310,7 +1309,7 @@ SQL
protected function getReservedKeywordsClass() : string protected function getReservedKeywordsClass() : string
{ {
return Keywords\SQLAnywhereKeywords::class; return Keywords\SQLAnywhere16Keywords::class;
} }
protected function initializeDoctrineTypeMappings() : void protected function initializeDoctrineTypeMappings() : void
......
...@@ -38,10 +38,9 @@ use function substr_count; ...@@ -38,10 +38,9 @@ use function substr_count;
use const PREG_OFFSET_CAPTURE; use const PREG_OFFSET_CAPTURE;
/** /**
* The SQLServerPlatform provides the behavior, features and SQL dialect of the * Provides the behavior, features and SQL dialect of the Microsoft SQL Server 2012 database platform.
* Microsoft SQL Server database platform.
*/ */
class SQLServerPlatform extends AbstractPlatform class SQLServer2012Platform extends AbstractPlatform
{ {
public function getCurrentDateSQL() : string public function getCurrentDateSQL() : string
{ {
...@@ -1370,7 +1369,7 @@ SQL ...@@ -1370,7 +1369,7 @@ SQL
protected function getReservedKeywordsClass() : string protected function getReservedKeywordsClass() : string
{ {
return Keywords\SQLServerKeywords::class; return Keywords\SQLServer2012Keywords::class;
} }
public function quoteSingleIdentifier(string $str) : string public function quoteSingleIdentifier(string $str) : string
......
...@@ -6,7 +6,7 @@ namespace Doctrine\DBAL\Schema; ...@@ -6,7 +6,7 @@ namespace Doctrine\DBAL\Schema;
use Doctrine\DBAL\Exception\DriverException; use Doctrine\DBAL\Exception\DriverException;
use Doctrine\DBAL\FetchMode; use Doctrine\DBAL\FetchMode;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types; use Doctrine\DBAL\Types\Types;
use function array_change_key_case; use function array_change_key_case;
...@@ -110,7 +110,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager ...@@ -110,7 +110,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
throw $exception; throw $exception;
} }
assert($this->_platform instanceof PostgreSqlPlatform); assert($this->_platform instanceof PostgreSQL94Platform);
$this->_execSql( $this->_execSql(
[ [
...@@ -494,7 +494,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager ...@@ -494,7 +494,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
$table = parent::listTableDetails($tableName); $table = parent::listTableDetails($tableName);
$platform = $this->_platform; $platform = $this->_platform;
assert($platform instanceof PostgreSqlPlatform); assert($platform instanceof PostgreSQL94Platform);
$sql = $platform->getListTableMetadataSQL($tableName); $sql = $platform->getListTableMetadataSQL($tableName);
$tableOptions = $this->_conn->fetchAssoc($sql); $tableOptions = $this->_conn->fetchAssoc($sql);
......
...@@ -4,7 +4,7 @@ declare(strict_types=1); ...@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace Doctrine\DBAL\Schema; namespace Doctrine\DBAL\Schema;
use Doctrine\DBAL\Platforms\SQLAnywherePlatform; use Doctrine\DBAL\Platforms\SQLAnywhere16Platform;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use function assert; use function assert;
use function is_string; use function is_string;
...@@ -47,13 +47,13 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager ...@@ -47,13 +47,13 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager
public function startDatabase(string $database) : void public function startDatabase(string $database) : void
{ {
assert($this->_platform instanceof SQLAnywherePlatform); assert($this->_platform instanceof SQLAnywhere16Platform);
$this->_execSql($this->_platform->getStartDatabaseSQL($database)); $this->_execSql($this->_platform->getStartDatabaseSQL($database));
} }
public function stopDatabase(string $database) : void public function stopDatabase(string $database) : void
{ {
assert($this->_platform instanceof SQLAnywherePlatform); assert($this->_platform instanceof SQLAnywhere16Platform);
$this->_execSql($this->_platform->getStopDatabaseSQL($database)); $this->_execSql($this->_platform->getStopDatabaseSQL($database));
} }
......
...@@ -6,7 +6,7 @@ namespace Doctrine\DBAL\Schema; ...@@ -6,7 +6,7 @@ namespace Doctrine\DBAL\Schema;
use Doctrine\DBAL\DBALException; use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver\DriverException; use Doctrine\DBAL\Driver\DriverException;
use Doctrine\DBAL\Platforms\SQLServerPlatform; use Doctrine\DBAL\Platforms\SQLServer2012Platform;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use PDOException; use PDOException;
use Throwable; use Throwable;
...@@ -330,7 +330,7 @@ class SQLServerSchemaManager extends AbstractSchemaManager ...@@ -330,7 +330,7 @@ class SQLServerSchemaManager extends AbstractSchemaManager
$table = parent::listTableDetails($tableName); $table = parent::listTableDetails($tableName);
$platform = $this->_platform; $platform = $this->_platform;
assert($platform instanceof SQLServerPlatform); assert($platform instanceof SQLServer2012Platform);
$sql = $platform->getListTableMetadataSQL($tableName); $sql = $platform->getListTableMetadataSQL($tableName);
$tableOptions = $this->_conn->fetchAssoc($sql); $tableOptions = $this->_conn->fetchAssoc($sql);
......
...@@ -12,11 +12,11 @@ use Doctrine\DBAL\Platforms\Keywords\MySQL80Keywords; ...@@ -12,11 +12,11 @@ use Doctrine\DBAL\Platforms\Keywords\MySQL80Keywords;
use Doctrine\DBAL\Platforms\Keywords\MySQLKeywords; use Doctrine\DBAL\Platforms\Keywords\MySQLKeywords;
use Doctrine\DBAL\Platforms\Keywords\OracleKeywords; use Doctrine\DBAL\Platforms\Keywords\OracleKeywords;
use Doctrine\DBAL\Platforms\Keywords\PostgreSQL100Keywords; use Doctrine\DBAL\Platforms\Keywords\PostgreSQL100Keywords;
use Doctrine\DBAL\Platforms\Keywords\PostgreSQLKeywords; use Doctrine\DBAL\Platforms\Keywords\PostgreSQL94Keywords;
use Doctrine\DBAL\Platforms\Keywords\ReservedKeywordsValidator; use Doctrine\DBAL\Platforms\Keywords\ReservedKeywordsValidator;
use Doctrine\DBAL\Platforms\Keywords\SQLAnywhereKeywords; use Doctrine\DBAL\Platforms\Keywords\SQLAnywhere16Keywords;
use Doctrine\DBAL\Platforms\Keywords\SQLiteKeywords; use Doctrine\DBAL\Platforms\Keywords\SQLiteKeywords;
use Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords; use Doctrine\DBAL\Platforms\Keywords\SQLServer2012Keywords;
use InvalidArgumentException; use InvalidArgumentException;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
...@@ -38,11 +38,11 @@ class ReservedWordsCommand extends Command ...@@ -38,11 +38,11 @@ class ReservedWordsCommand extends Command
'mysql80' => MySQL80Keywords::class, 'mysql80' => MySQL80Keywords::class,
'mariadb102' => MariaDb102Keywords::class, 'mariadb102' => MariaDb102Keywords::class,
'oracle' => OracleKeywords::class, 'oracle' => OracleKeywords::class,
'pgsql' => PostgreSQLKeywords::class, 'pgsql' => PostgreSQL94Keywords::class,
'pgsql100' => PostgreSQL100Keywords::class, 'pgsql100' => PostgreSQL100Keywords::class,
'sqlanywhere' => SQLAnywhereKeywords::class, 'sqlanywhere' => SQLAnywhere16Keywords::class,
'sqlite' => SQLiteKeywords::class, 'sqlite' => SQLiteKeywords::class,
'sqlserver' => SQLServerKeywords::class, 'sqlserver' => SQLServer2012Keywords::class,
]; ];
/** /**
......
...@@ -9,7 +9,7 @@ use Doctrine\DBAL\Driver; ...@@ -9,7 +9,7 @@ use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\AbstractPostgreSQLDriver; use Doctrine\DBAL\Driver\AbstractPostgreSQLDriver;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\PostgreSQL100Platform; use Doctrine\DBAL\Platforms\PostgreSQL100Platform;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\PostgreSqlSchemaManager; use Doctrine\DBAL\Schema\PostgreSqlSchemaManager;
...@@ -22,7 +22,7 @@ class AbstractPostgreSQLDriverTest extends AbstractDriverTest ...@@ -22,7 +22,7 @@ class AbstractPostgreSQLDriverTest extends AbstractDriverTest
protected function createPlatform() : AbstractPlatform protected function createPlatform() : AbstractPlatform
{ {
return new PostgreSqlPlatform(); return new PostgreSQL94Platform();
} }
protected function createSchemaManager(Connection $connection) : AbstractSchemaManager protected function createSchemaManager(Connection $connection) : AbstractSchemaManager
...@@ -36,9 +36,9 @@ class AbstractPostgreSQLDriverTest extends AbstractDriverTest ...@@ -36,9 +36,9 @@ class AbstractPostgreSQLDriverTest extends AbstractDriverTest
protected function getDatabasePlatformsForVersions() : array protected function getDatabasePlatformsForVersions() : array
{ {
return [ return [
['9.4', PostgreSqlPlatform::class], ['9.4', PostgreSQL94Platform::class],
['9.4.0', PostgreSqlPlatform::class], ['9.4.0', PostgreSQL94Platform::class],
['9.4.1', PostgreSqlPlatform::class], ['9.4.1', PostgreSQL94Platform::class],
['10', PostgreSQL100Platform::class], ['10', PostgreSQL100Platform::class],
]; ];
} }
......
...@@ -8,7 +8,7 @@ use Doctrine\DBAL\Connection; ...@@ -8,7 +8,7 @@ use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver; use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\AbstractSQLAnywhereDriver; use Doctrine\DBAL\Driver\AbstractSQLAnywhereDriver;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\SQLAnywherePlatform; use Doctrine\DBAL\Platforms\SQLAnywhere16Platform;
use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\SQLAnywhereSchemaManager; use Doctrine\DBAL\Schema\SQLAnywhereSchemaManager;
...@@ -21,7 +21,7 @@ class AbstractSQLAnywhereDriverTest extends AbstractDriverTest ...@@ -21,7 +21,7 @@ class AbstractSQLAnywhereDriverTest extends AbstractDriverTest
protected function createPlatform() : AbstractPlatform protected function createPlatform() : AbstractPlatform
{ {
return new SQLAnywherePlatform(); return new SQLAnywhere16Platform();
} }
protected function createSchemaManager(Connection $connection) : AbstractSchemaManager protected function createSchemaManager(Connection $connection) : AbstractSchemaManager
...@@ -35,13 +35,13 @@ class AbstractSQLAnywhereDriverTest extends AbstractDriverTest ...@@ -35,13 +35,13 @@ class AbstractSQLAnywhereDriverTest extends AbstractDriverTest
protected function getDatabasePlatformsForVersions() : array protected function getDatabasePlatformsForVersions() : array
{ {
return [ return [
['16', SQLAnywherePlatform::class], ['16', SQLAnywhere16Platform::class],
['16.0', SQLAnywherePlatform::class], ['16.0', SQLAnywhere16Platform::class],
['16.0.0', SQLAnywherePlatform::class], ['16.0.0', SQLAnywhere16Platform::class],
['16.0.0.0', SQLAnywherePlatform::class], ['16.0.0.0', SQLAnywhere16Platform::class],
['16.1.2.3', SQLAnywherePlatform::class], ['16.1.2.3', SQLAnywhere16Platform::class],
['16.9.9.9', SQLAnywherePlatform::class], ['16.9.9.9', SQLAnywhere16Platform::class],
['17', SQLAnywherePlatform::class], ['17', SQLAnywhere16Platform::class],
]; ];
} }
......
...@@ -8,7 +8,7 @@ use Doctrine\DBAL\Connection; ...@@ -8,7 +8,7 @@ use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver; use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\AbstractSQLServerDriver; use Doctrine\DBAL\Driver\AbstractSQLServerDriver;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\SQLServerPlatform; use Doctrine\DBAL\Platforms\SQLServer2012Platform;
use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\SQLServerSchemaManager; use Doctrine\DBAL\Schema\SQLServerSchemaManager;
...@@ -21,7 +21,7 @@ class AbstractSQLServerDriverTest extends AbstractDriverTest ...@@ -21,7 +21,7 @@ class AbstractSQLServerDriverTest extends AbstractDriverTest
protected function createPlatform() : AbstractPlatform protected function createPlatform() : AbstractPlatform
{ {
return new SQLServerPlatform(); return new SQLServer2012Platform();
} }
protected function createSchemaManager(Connection $connection) : AbstractSchemaManager protected function createSchemaManager(Connection $connection) : AbstractSchemaManager
...@@ -35,7 +35,7 @@ class AbstractSQLServerDriverTest extends AbstractDriverTest ...@@ -35,7 +35,7 @@ class AbstractSQLServerDriverTest extends AbstractDriverTest
protected function getDatabasePlatformsForVersions() : array protected function getDatabasePlatformsForVersions() : array
{ {
return [ return [
['12', SQLServerPlatform::class], ['12', SQLServer2012Platform::class],
]; ];
} }
} }
...@@ -11,7 +11,7 @@ use Doctrine\DBAL\Driver\PDOConnection; ...@@ -11,7 +11,7 @@ use Doctrine\DBAL\Driver\PDOConnection;
use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform; use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Platforms\SQLServerPlatform; use Doctrine\DBAL\Platforms\SQLServer2012Platform;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use Doctrine\Tests\TestUtil; use Doctrine\Tests\TestUtil;
use Error; use Error;
...@@ -365,7 +365,7 @@ class ConnectionTest extends DbalFunctionalTestCase ...@@ -365,7 +365,7 @@ class ConnectionTest extends DbalFunctionalTestCase
$platform = $this->connection->getDatabasePlatform(); $platform = $this->connection->getDatabasePlatform();
if ($platform instanceof SqlitePlatform if ($platform instanceof SqlitePlatform
|| $platform instanceof SQLServerPlatform) { || $platform instanceof SQLServer2012Platform) {
self::markTestSkipped('The platform does not support persistent connections'); self::markTestSkipped('The platform does not support persistent connections');
} }
......
...@@ -6,7 +6,7 @@ namespace Doctrine\Tests\DBAL\Functional\Driver; ...@@ -6,7 +6,7 @@ namespace Doctrine\Tests\DBAL\Functional\Driver;
use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\FetchMode; use Doctrine\DBAL\FetchMode;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use function extension_loaded; use function extension_loaded;
...@@ -20,7 +20,7 @@ class PDOPgsqlConnectionTest extends DbalFunctionalTestCase ...@@ -20,7 +20,7 @@ class PDOPgsqlConnectionTest extends DbalFunctionalTestCase
parent::setUp(); parent::setUp();
if ($this->connection->getDatabasePlatform() instanceof PostgreSqlPlatform) { if ($this->connection->getDatabasePlatform() instanceof PostgreSQL94Platform) {
return; return;
} }
......
...@@ -9,7 +9,7 @@ use Doctrine\DBAL\Driver\ServerInfoAwareConnection; ...@@ -9,7 +9,7 @@ use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Exception; use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Platforms\MySqlPlatform; use Doctrine\DBAL\Platforms\MySqlPlatform;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Platforms\SqlitePlatform; use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
...@@ -219,7 +219,7 @@ EOT ...@@ -219,7 +219,7 @@ EOT
$this->markTestSkipped('Only skipped if platform is not sqlite'); $this->markTestSkipped('Only skipped if platform is not sqlite');
} }
if ($platform instanceof PostgreSqlPlatform && isset($params['password'])) { if ($platform instanceof PostgreSQL94Platform && isset($params['password'])) {
$this->markTestSkipped('Does not work on Travis'); $this->markTestSkipped('Does not work on Travis');
} }
......
...@@ -4,7 +4,7 @@ declare(strict_types=1); ...@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace Doctrine\Tests\DBAL\Functional\Platform\ColumnTest; namespace Doctrine\Tests\DBAL\Functional\Platform\ColumnTest;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\Tests\DBAL\Functional\Platform\ColumnTest; use Doctrine\Tests\DBAL\Functional\Platform\ColumnTest;
final class PostgreSQL extends ColumnTest final class PostgreSQL extends ColumnTest
...@@ -13,6 +13,6 @@ final class PostgreSQL extends ColumnTest ...@@ -13,6 +13,6 @@ final class PostgreSQL extends ColumnTest
{ {
parent::setUp(); parent::setUp();
$this->requirePlatform(PostgreSqlPlatform::class); $this->requirePlatform(PostgreSQL94Platform::class);
} }
} }
...@@ -4,7 +4,7 @@ declare(strict_types=1); ...@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace Doctrine\Tests\DBAL\Functional\Platform\ColumnTest; namespace Doctrine\Tests\DBAL\Functional\Platform\ColumnTest;
use Doctrine\DBAL\Platforms\SQLServerPlatform; use Doctrine\DBAL\Platforms\SQLServer2012Platform;
use Doctrine\Tests\DBAL\Functional\Platform\ColumnTest; use Doctrine\Tests\DBAL\Functional\Platform\ColumnTest;
final class SQLServer extends ColumnTest final class SQLServer extends ColumnTest
...@@ -13,7 +13,7 @@ final class SQLServer extends ColumnTest ...@@ -13,7 +13,7 @@ final class SQLServer extends ColumnTest
{ {
parent::setUp(); parent::setUp();
$this->requirePlatform(SQLServerPlatform::class); $this->requirePlatform(SQLServer2012Platform::class);
} }
public function testVariableLengthStringNoLength() : void public function testVariableLengthStringNoLength() : void
......
...@@ -5,7 +5,7 @@ declare(strict_types=1); ...@@ -5,7 +5,7 @@ declare(strict_types=1);
namespace Doctrine\Tests\DBAL\Functional\Schema; namespace Doctrine\Tests\DBAL\Functional\Schema;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Schema; use Doctrine\DBAL\Schema;
use Doctrine\DBAL\Schema\Comparator; use Doctrine\DBAL\Schema\Comparator;
use Doctrine\DBAL\Schema\ForeignKeyConstraint; use Doctrine\DBAL\Schema\ForeignKeyConstraint;
...@@ -417,7 +417,7 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -417,7 +417,7 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
public function testJsonbColumn() : void public function testJsonbColumn() : void
{ {
if (! $this->schemaManager->getDatabasePlatform() instanceof PostgreSqlPlatform) { if (! $this->schemaManager->getDatabasePlatform() instanceof PostgreSQL94Platform) {
$this->markTestSkipped('Requires PostgresSQL 9.4+'); $this->markTestSkipped('Requires PostgresSQL 9.4+');
return; return;
......
...@@ -4,7 +4,7 @@ declare(strict_types=1); ...@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace Doctrine\Tests\DBAL\Platforms; namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Column;
use Doctrine\DBAL\Schema\ColumnDiff; use Doctrine\DBAL\Schema\ColumnDiff;
use Doctrine\DBAL\Schema\Comparator; use Doctrine\DBAL\Schema\Comparator;
...@@ -18,9 +18,9 @@ use UnexpectedValueException; ...@@ -18,9 +18,9 @@ use UnexpectedValueException;
use function assert; use function assert;
use function sprintf; use function sprintf;
abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCase abstract class AbstractPostgreSQLPlatformTestCase extends AbstractPlatformTestCase
{ {
/** @var PostgreSqlPlatform */ /** @var PostgreSQL94Platform */
protected $platform; protected $platform;
public function getGenerateTableSql() : string public function getGenerateTableSql() : string
...@@ -921,7 +921,7 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa ...@@ -921,7 +921,7 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa
*/ */
public function testReturnsDisallowDatabaseConnectionsSQL() : void public function testReturnsDisallowDatabaseConnectionsSQL() : void
{ {
assert($this->platform instanceof PostgreSqlPlatform); assert($this->platform instanceof PostgreSQL94Platform);
self::assertSame( self::assertSame(
"UPDATE pg_database SET datallowconn = 'false' WHERE datname = 'foo'", "UPDATE pg_database SET datallowconn = 'false' WHERE datname = 'foo'",
...@@ -934,7 +934,7 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa ...@@ -934,7 +934,7 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa
*/ */
public function testReturnsCloseActiveDatabaseConnectionsSQL() : void public function testReturnsCloseActiveDatabaseConnectionsSQL() : void
{ {
assert($this->platform instanceof PostgreSqlPlatform); assert($this->platform instanceof PostgreSQL94Platform);
self::assertSame( self::assertSame(
"SELECT pg_terminate_backend(procpid) FROM pg_stat_activity WHERE datname = 'foo'", "SELECT pg_terminate_backend(procpid) FROM pg_stat_activity WHERE datname = 'foo'",
...@@ -1024,7 +1024,7 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa ...@@ -1024,7 +1024,7 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa
*/ */
public function testQuotesDatabaseNameInCloseActiveDatabaseConnectionsSQL() : void public function testQuotesDatabaseNameInCloseActiveDatabaseConnectionsSQL() : void
{ {
assert($this->platform instanceof PostgreSqlPlatform); assert($this->platform instanceof PostgreSQL94Platform);
self::assertStringContainsStringIgnoringCase( self::assertStringContainsStringIgnoringCase(
"'Foo''Bar\\'", "'Foo''Bar\\'",
......
...@@ -6,7 +6,7 @@ namespace Doctrine\Tests\DBAL\Platforms; ...@@ -6,7 +6,7 @@ namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\DBALException; use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception\ColumnLengthRequired; use Doctrine\DBAL\Exception\ColumnLengthRequired;
use Doctrine\DBAL\Platforms\SQLServerPlatform; use Doctrine\DBAL\Platforms\SQLServer2012Platform;
use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Column;
use Doctrine\DBAL\Schema\ColumnDiff; use Doctrine\DBAL\Schema\ColumnDiff;
use Doctrine\DBAL\Schema\Index; use Doctrine\DBAL\Schema\Index;
...@@ -1096,7 +1096,7 @@ abstract class AbstractSQLServerPlatformTestCase extends AbstractPlatformTestCas ...@@ -1096,7 +1096,7 @@ abstract class AbstractSQLServerPlatformTestCase extends AbstractPlatformTestCas
*/ */
public function testGeneratesIdentifierNamesInDefaultConstraintDeclarationSQL(string $table, array $column, string $expectedSql) : void public function testGeneratesIdentifierNamesInDefaultConstraintDeclarationSQL(string $table, array $column, string $expectedSql) : void
{ {
assert($this->platform instanceof SQLServerPlatform); assert($this->platform instanceof SQLServer2012Platform);
self::assertSame($expectedSql, $this->platform->getDefaultConstraintDeclarationSQL($table, $column)); self::assertSame($expectedSql, $this->platform->getDefaultConstraintDeclarationSQL($table, $column));
} }
......
...@@ -7,7 +7,7 @@ namespace Doctrine\Tests\DBAL\Platforms; ...@@ -7,7 +7,7 @@ namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\PostgreSQL100Platform; use Doctrine\DBAL\Platforms\PostgreSQL100Platform;
class PostgreSQL100PlatformTest extends PostgreSqlPlatformTest class PostgreSQL100PlatformTest extends PostgreSQL94PlatformTest
{ {
public function createPlatform() : AbstractPlatform public function createPlatform() : AbstractPlatform
{ {
......
...@@ -5,16 +5,16 @@ declare(strict_types=1); ...@@ -5,16 +5,16 @@ declare(strict_types=1);
namespace Doctrine\Tests\DBAL\Platforms; namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Types\Types; use Doctrine\DBAL\Types\Types;
use function assert; use function assert;
class PostgreSqlPlatformTest extends AbstractPostgreSqlPlatformTestCase class PostgreSQL94PlatformTest extends AbstractPostgreSQLPlatformTestCase
{ {
public function createPlatform() : AbstractPlatform public function createPlatform() : AbstractPlatform
{ {
return new PostgreSqlPlatform(); return new PostgreSQL94Platform();
} }
public function testSupportsPartialIndexes() : void public function testSupportsPartialIndexes() : void
...@@ -97,7 +97,7 @@ class PostgreSqlPlatformTest extends AbstractPostgreSqlPlatformTestCase ...@@ -97,7 +97,7 @@ class PostgreSqlPlatformTest extends AbstractPostgreSqlPlatformTestCase
*/ */
public function testReturnsCloseActiveDatabaseConnectionsSQL() : void public function testReturnsCloseActiveDatabaseConnectionsSQL() : void
{ {
assert($this->platform instanceof PostgreSqlPlatform); assert($this->platform instanceof PostgreSQL94Platform);
self::assertSame( self::assertSame(
"SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = 'foo'", "SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = 'foo'",
......
...@@ -8,7 +8,7 @@ use Doctrine\DBAL\DBALException; ...@@ -8,7 +8,7 @@ use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception\ColumnLengthRequired; use Doctrine\DBAL\Exception\ColumnLengthRequired;
use Doctrine\DBAL\LockMode; use Doctrine\DBAL\LockMode;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\SQLAnywherePlatform; use Doctrine\DBAL\Platforms\SQLAnywhere16Platform;
use Doctrine\DBAL\Platforms\TrimMode; use Doctrine\DBAL\Platforms\TrimMode;
use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Column;
use Doctrine\DBAL\Schema\ColumnDiff; use Doctrine\DBAL\Schema\ColumnDiff;
...@@ -27,14 +27,14 @@ use function mt_rand; ...@@ -27,14 +27,14 @@ use function mt_rand;
use function strlen; use function strlen;
use function substr; use function substr;
class SQLAnywherePlatformTest extends AbstractPlatformTestCase class SQLAnywhere16PlatformTest extends AbstractPlatformTestCase
{ {
/** @var SQLAnywherePlatform */ /** @var SQLAnywhere16Platform */
protected $platform; protected $platform;
public function createPlatform() : AbstractPlatform public function createPlatform() : AbstractPlatform
{ {
return new SQLAnywherePlatform(); return new SQLAnywhere16Platform();
} }
/** /**
...@@ -414,7 +414,7 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase ...@@ -414,7 +414,7 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
$this->platform->getForeignKeyDeclarationSQL( $this->platform->getForeignKeyDeclarationSQL(
new ForeignKeyConstraint(['a', 'b'], 'foreign_table', ['c', 'd'], 'fk', [ new ForeignKeyConstraint(['a', 'b'], 'foreign_table', ['c', 'd'], 'fk', [
'notnull' => true, 'notnull' => true,
'match' => SQLAnywherePlatform::FOREIGN_KEY_MATCH_SIMPLE_UNIQUE, 'match' => SQLAnywhere16Platform::FOREIGN_KEY_MATCH_SIMPLE_UNIQUE,
'onUpdate' => 'CASCADE', 'onUpdate' => 'CASCADE',
'onDelete' => 'SET NULL', 'onDelete' => 'SET NULL',
'check_on_commit' => true, 'check_on_commit' => true,
......
...@@ -6,13 +6,13 @@ namespace Doctrine\Tests\DBAL\Platforms; ...@@ -6,13 +6,13 @@ namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\LockMode; use Doctrine\DBAL\LockMode;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\SQLServerPlatform; use Doctrine\DBAL\Platforms\SQLServer2012Platform;
class SQLServerPlatformTest extends AbstractSQLServerPlatformTestCase class SQLServerPlatform2012Test extends AbstractSQLServerPlatformTestCase
{ {
public function createPlatform() : AbstractPlatform public function createPlatform() : AbstractPlatform
{ {
return new SQLServerPlatform(); return new SQLServer2012Platform();
} }
/** /**
......
...@@ -6,7 +6,7 @@ namespace Doctrine\Tests\DBAL\Schema; ...@@ -6,7 +6,7 @@ namespace Doctrine\Tests\DBAL\Schema;
use Doctrine\DBAL\Platforms\MySqlPlatform; use Doctrine\DBAL\Platforms\MySqlPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform; use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Platforms\SQLServerPlatform; use Doctrine\DBAL\Platforms\SQLServer2012Platform;
use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Column;
use Doctrine\DBAL\Schema\Exception\UnknownColumnOption; use Doctrine\DBAL\Schema\Exception\UnknownColumnOption;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
...@@ -120,7 +120,7 @@ class ColumnTest extends TestCase ...@@ -120,7 +120,7 @@ class ColumnTest extends TestCase
$column = new Column('[bar]', $string); $column = new Column('[bar]', $string);
$sqlServerPlatform = new SQLServerPlatform(); $sqlServerPlatform = new SQLServer2012Platform();
self::assertEquals('bar', $column->getName()); self::assertEquals('bar', $column->getName());
self::assertEquals('[bar]', $column->getQuotedName($sqlServerPlatform)); self::assertEquals('[bar]', $column->getQuotedName($sqlServerPlatform));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment