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

Merge branch '3.0.x'

parents 01143c9c 40cc9bd5
This diff is collapsed.
...@@ -351,7 +351,7 @@ You can also pass this option if you want to disable automatic database platform ...@@ -351,7 +351,7 @@ You can also pass this option if you want to disable automatic database platform
detection for a driver that natively supports it and choose the platform version detection for a driver that natively supports it and choose the platform version
implementation explicitly. implementation explicitly.
If you are running a MariaDB database, you should prefix the ``serverVersion`` If you are running a MariaDB database, you should prefix the ``serverVersion``
with ``mariadb-`` (ex: ``mariadb-10.2.12``). with ``mariadb-`` (ex: ``mariadb-10.2.12``).
Custom Platform Custom Platform
......
...@@ -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