From d64e6e02b1ae224b4bc33e5fd4691a4dcbdcdbdc Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Wed, 7 Mar 2018 20:04:42 +0100 Subject: [PATCH] Drop Drizzle support --- docs/en/reference/configuration.rst | 27 +- docs/en/reference/introduction.rst | 1 - docs/en/reference/platforms.rst | 5 - docs/en/reference/schema-representation.rst | 10 +- docs/en/reference/types.rst | 38 +- .../Driver/DrizzlePDOMySql/Connection.php | 23 - .../DBAL/Driver/DrizzlePDOMySql/Driver.php | 61 -- lib/Doctrine/DBAL/DriverManager.php | 2 - .../DBAL/Platforms/DrizzlePlatform.php | 607 ------------------ .../Platforms/Keywords/DrizzleKeywords.php | 328 ---------- lib/Doctrine/DBAL/Portability/Connection.php | 3 - .../DBAL/Schema/DrizzleSchemaManager.php | 102 --- .../Driver/DrizzlePDOMySql/DriverTest.php | 46 -- .../Doctrine/Tests/DBAL/DriverManagerTest.php | 7 +- .../Tests/DBAL/Functional/ExceptionTest.php | 4 - .../Schema/DrizzleSchemaManagerTest.php | 47 -- 16 files changed, 11 insertions(+), 1300 deletions(-) delete mode 100644 lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Connection.php delete mode 100644 lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Driver.php delete mode 100644 lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php delete mode 100644 lib/Doctrine/DBAL/Platforms/Keywords/DrizzleKeywords.php delete mode 100644 lib/Doctrine/DBAL/Schema/DrizzleSchemaManager.php delete mode 100644 tests/Doctrine/Tests/DBAL/Driver/DrizzlePDOMySql/DriverTest.php delete mode 100644 tests/Doctrine/Tests/DBAL/Functional/Schema/DrizzleSchemaManagerTest.php diff --git a/docs/en/reference/configuration.rst b/docs/en/reference/configuration.rst index 24b9a50fd5c..424023648ae 100644 --- a/docs/en/reference/configuration.rst +++ b/docs/en/reference/configuration.rst @@ -73,12 +73,8 @@ full driver name:: pdo-mysql://localhost:4486/foo?charset=UTF-8 -If you wanted to use the ``drizzle_pdo__mysql`` driver instead:: - - drizzle-pdo-mysql://localhost:4486/foo?charset=UTF-8 - -In the last two examples above, mind the dashes instead of the -underscores in the URL schemes. +In the example above, mind the dashes instead of the +underscores in the URL scheme. For connecting to an SQLite database, the authority portion of the URL is obviously irrelevant and thus can be omitted. The path part @@ -128,8 +124,6 @@ interfaces to use. It can be configured in one of three ways: - ``pdo_mysql``: A MySQL driver that uses the pdo\_mysql PDO extension. - - ``drizzle_pdo_mysql``: A Drizzle driver that uses pdo\_mysql PDO - extension. - ``mysqli``: A MySQL driver that uses the mysqli extension. - ``pdo_sqlite``: An SQLite driver that uses the pdo\_sqlite PDO extension. @@ -198,23 +192,6 @@ pdo\_mysql - ``charset`` (string): The charset used when connecting to the database. -drizzle\_pdo\_mysql -^^^^^^^^^^^^^^^^^^^ - -**Requires** drizzle plugin ``mysql_protocol`` or ``mysql_unix_socket_protocol`` to be enabled. -On Ubuntu this can be done by editing ``/etc/drizzle/conf.d/mysql-protocol.cnf`` -or ``/etc/drizzle/conf.d/mysql-unix-socket-protocol.cnf`` and restarting the drizzled daemon. - -- ``user`` (string): Username to use when connecting to the - database. Only needed if authentication is configured for drizzled. -- ``password`` (string): Password to use when connecting to the - database. Only needed if authentication is configured for drizzled. -- ``host`` (string): Hostname of the database to connect to. -- ``port`` (integer): Port of the database to connect to. -- ``dbname`` (string): Name of the database/schema to connect to. -- ``unix_socket`` (string): Name of the socket used to connect to - the database. - mysqli ^^^^^^ diff --git a/docs/en/reference/introduction.rst b/docs/en/reference/introduction.rst index e52f7fff858..97b8c2bff5f 100644 --- a/docs/en/reference/introduction.rst +++ b/docs/en/reference/introduction.rst @@ -21,7 +21,6 @@ The following database vendors are currently supported: - PostgreSQL - SAP Sybase SQL Anywhere - SQLite -- Drizzle The Doctrine 2 database layer can be used independently of the object-relational mapper. In order to use the DBAL all you need is diff --git a/docs/en/reference/platforms.rst b/docs/en/reference/platforms.rst index 2505680f7ce..19917bf4f18 100644 --- a/docs/en/reference/platforms.rst +++ b/docs/en/reference/platforms.rst @@ -70,11 +70,6 @@ SQLite - ``SqlitePlatform`` for all versions. -Drizzle -^^^^^^ - -- ``DrizzlePlatform`` for all versions. - It is highly encouraged to use the platform class that matches your database vendor and version best. Otherwise it is not guaranteed that the compatibility in terms of SQL dialect and feature support diff --git a/docs/en/reference/schema-representation.rst b/docs/en/reference/schema-representation.rst index b250a5c5109..381a997e321 100644 --- a/docs/en/reference/schema-representation.rst +++ b/docs/en/reference/schema-representation.rst @@ -115,10 +115,10 @@ The following options are not completely portable but are supported by most of t vendors: - **unsigned** (boolean): Whether a ``smallint``, ``integer`` or ``bigint`` Doctrine - type column should allow unsigned values only. Supported by MySQL, SQL Anywhere - and Drizzle. Defaults to ``false``. + type column should allow unsigned values only. Supported by MySQL and SQL Anywhere. + Defaults to ``false``. - **comment** (integer|string): The column comment. Supported by MySQL, PostgreSQL, - Oracle, SQL Server, SQL Anywhere and Drizzle. Defaults to ``null``. + Oracle, SQL Server and SQL Anywhere. Defaults to ``null``. Vendor specific options ^^^^^^^^^^^^^^^^^^^^^^^ @@ -133,8 +133,8 @@ The following options are completely vendor specific and absolutely not portable supported by some vendors but not portable: - **charset** (string): The character set to use for the column. Currently only supported - on MySQL and Drizzle. + on MySQL. - **collation** (string): The collation to use for the column. Supported by MySQL, PostgreSQL, - Sqlite, SQL Server and Drizzle. + Sqlite and SQL Server. - **check** (string): The check constraint clause to add to the column. Defaults to ``null``. diff --git a/docs/en/reference/types.rst b/docs/en/reference/types.rst index da6cf021f1b..7d0559a6fdf 100644 --- a/docs/en/reference/types.rst +++ b/docs/en/reference/types.rst @@ -511,8 +511,6 @@ Please also notice the mapping specific footnotes for additional information. +===================+===============+==========================+=========+==========================================================+ | **smallint** | ``integer`` | **MySQL** | *all* | ``SMALLINT`` ``UNSIGNED`` [10]_ ``AUTO_INCREMENT`` [11]_ | | | +--------------------------+---------+----------------------------------------------------------+ -| | | **Drizzle** | *all* | ``INT`` ``UNSIGNED`` [10]_ ``AUTO_INCREMENT`` [11]_ | -| | +--------------------------+---------+----------------------------------------------------------+ | | | **PostgreSQL** | *all* | ``SMALLINT`` | | | +--------------------------+---------+----------------------------------------------------------+ | | | **Oracle** | *all* | ``NUMBER(5)`` | @@ -524,8 +522,6 @@ Please also notice the mapping specific footnotes for additional information. | | | **SQLite** | *all* | ``INTEGER`` [16]_ | +-------------------+---------------+--------------------------+---------+----------------------------------------------------------+ | **integer** | ``integer`` | **MySQL** | *all* | ``INT`` ``UNSIGNED`` [10]_ ``AUTO_INCREMENT`` [11]_ | -| | +--------------------------+ | | -| | | **Drizzle** | | | | | +--------------------------+---------+----------------------------------------------------------+ | | | **PostgreSQL** | *all* | ``INT`` [12]_ | | | | | +----------------------------------------------------------+ @@ -540,9 +536,7 @@ Please also notice the mapping specific footnotes for additional information. | | | **SQLite** | *all* | ``INTEGER`` [16]_ | +-------------------+---------------+--------------------------+---------+----------------------------------------------------------+ | **bigint** | ``string`` | **MySQL** | *all* | ``BIGINT`` ``UNSIGNED`` [10]_ ``AUTO_INCREMENT`` [11]_ | -| | [8]_ +--------------------------+ | | -| | | **Drizzle** | | | -| | +--------------------------+---------+----------------------------------------------------------+ +| | [8]_ +--------------------------+---------+----------------------------------------------------------+ | | | **PostgreSQL** | *all* | ``BIGINT`` [12]_ | | | | | +----------------------------------------------------------+ | | | | | ``BIGSERIAL`` [11]_ | @@ -566,8 +560,6 @@ Please also notice the mapping specific footnotes for additional information. | | | **SQL Anywhere** | | | | | +--------------------------+ | | | | | **SQLite** | | | -| | +--------------------------+ | | -| | | **Drizzle** | | | +-------------------+---------------+--------------------------+---------+----------------------------------------------------------+ | **float** | ``float`` | **MySQL** | *all* | ``DOUBLE PRECISION`` ``UNSIGNED`` [10]_ | | | +--------------------------+---------+----------------------------------------------------------+ @@ -580,8 +572,6 @@ Please also notice the mapping specific footnotes for additional information. | | | **SQL Anywhere** | | | | | +--------------------------+ | | | | | **SQLite** | | | -| | +--------------------------+ | | -| | | **Drizzle** | | | +-------------------+---------------+--------------------------+---------+----------------------------------------------------------+ | **string** | ``string`` | **MySQL** | *all* | ``VARCHAR(n)`` [3]_ | | [2]_ [5]_ | +--------------------------+ | | @@ -591,8 +581,6 @@ Please also notice the mapping specific footnotes for additional information. | | +--------------------------+ | | | | | **SQLite** | | | | | +--------------------------+---------+----------------------------------------------------------+ -| | | **Drizzle** | *all* | ``VARCHAR(n)`` | -| | +--------------------------+---------+----------------------------------------------------------+ | | | **Oracle** | *all* | ``VARCHAR2(n)`` [3]_ | | | | | +----------------------------------------------------------+ | | | | | ``CHAR(n)`` [4]_ | @@ -612,8 +600,6 @@ Please also notice the mapping specific footnotes for additional information. | | | **PostgreSQL** | *all* | ``TEXT`` | | | +--------------------------+ | | | | | **SQL Anywhere** | | | -| | +--------------------------+ | | -| | | **Drizzle** | | | | | +--------------------------+---------+----------------------------------------------------------+ | | | **Oracle** | *all* | ``CLOB`` | | | +--------------------------+ | | @@ -626,8 +612,6 @@ Please also notice the mapping specific footnotes for additional information. | | | **Oracle** | | | | | +--------------------------+ | | | | | **SQLite** | | | -| | +--------------------------+ | | -| | | **Drizzle** | | | | | +--------------------------+---------+----------------------------------------------------------+ | | | **SQL Server** | *all* | ``UNIQUEIDENTIFIER`` | | | +--------------------------+ | | @@ -641,8 +625,6 @@ Please also notice the mapping specific footnotes for additional information. | | +--------------------------+ | ``BINARY(n)`` [4]_ | | | | **SQL Anywhere** | | | | | +--------------------------+---------+----------------------------------------------------------+ -| | | **Drizzle** | *all* | ``VARBINARY(n)`` | -| | +--------------------------+---------+----------------------------------------------------------+ | | | **Oracle** | *all* | ``RAW(n)`` | | | +--------------------------+---------+----------------------------------------------------------+ | | | **PostgreSQL** | *all* | ``BYTEA`` [16]_ | @@ -660,8 +642,6 @@ Please also notice the mapping specific footnotes for additional information. | | | **Oracle** | *all* | ``BLOB`` | | | +--------------------------+ | | | | | **SQLite** | | | -| | +--------------------------+ | | -| | | **Drizzle** | | | | | +--------------------------+---------+----------------------------------------------------------+ | | | **SQL Server** | *all* | ``VARBINARY(MAX)`` | | | +--------------------------+---------+----------------------------------------------------------+ @@ -674,8 +654,6 @@ Please also notice the mapping specific footnotes for additional information. | | | **PostgreSQL** | *all* | ``BOOLEAN`` | | | +--------------------------+ | | | | | **SQLite** | | | -| | +--------------------------+ | | -| | | **Drizzle** | | | | | +--------------------------+---------+----------------------------------------------------------+ | | | **SQL Server** | *all* | ``BIT`` | | | +--------------------------+ | | @@ -692,16 +670,12 @@ Please also notice the mapping specific footnotes for additional information. | | | **SQL Anywhere** | | | | | +--------------------------+ | | | | | **SQLite** | | | -| | +--------------------------+ | | -| | | **Drizzle** | | | | | +--------------------------+---------+ | | | | **SQL Server** | >= 2008 | | | | | +---------+----------------------------------------------------------+ | | | | < 2008 | ``DATETIME`` [16]_ | +-------------------+---------------+--------------------------+---------+----------------------------------------------------------+ | **datetime** | ``\DateTime`` | **MySQL** | *all* | ``DATETIME`` [13]_ | -| | +--------------------------+ +----------------------------------------------------------+ -| | | **Drizzle** | | ``TIMESTAMP`` [14]_ | | | +--------------------------+---------+----------------------------------------------------------+ | | | **SQL Server** | *all* | ``DATETIME`` | | | +--------------------------+ | | @@ -715,8 +689,6 @@ Please also notice the mapping specific footnotes for additional information. +-------------------+---------------+--------------------------+---------+----------------------------------------------------------+ | **datetimetz** | ``\DateTime`` | **MySQL** | *all* | ``DATETIME`` [15]_ [16]_ | | | +--------------------------+ | | -| | | **Drizzle** | | | -| | +--------------------------+ | | | | | **SQLite** | | | | | +--------------------------+---------+ | | | | **SQL Server** | < 2008 | | @@ -736,8 +708,6 @@ Please also notice the mapping specific footnotes for additional information. | | | **SQL Anywhere** | | | | | +--------------------------+ | | | | | **SQLite** | | | -| | +--------------------------+ | | -| | | **Drizzle** | | | | | +--------------------------+---------+----------------------------------------------------------+ | | | **PostgreSQL** | *all* | ``TIME(0) WITHOUT TIME ZONE`` | | | +--------------------------+---------+----------------------------------------------------------+ @@ -758,8 +728,6 @@ Please also notice the mapping specific footnotes for additional information. | | | **PostgreSQL** | *all* | ``TEXT`` | | | +--------------------------+ | | | | | **SQL Anywhere** | | | -| | +--------------------------+ | | -| | | **Drizzle** | | | | | +--------------------------+---------+----------------------------------------------------------+ | | | **Oracle** | *all* | ``CLOB`` | | | +--------------------------+ | | @@ -784,8 +752,6 @@ Please also notice the mapping specific footnotes for additional information. | | | | | ``JSONB`` [22]_ | | | +--------------------------+---------+----------------------------------------------------------+ | | | **SQL Anywhere** | *all* | ``TEXT`` [1]_ | -| | +--------------------------+ | | -| | | **Drizzle** | | | | | +--------------------------+---------+----------------------------------------------------------+ | | | **Oracle** | *all* | ``CLOB`` [1]_ | | | +--------------------------+ | | @@ -804,8 +770,6 @@ Please also notice the mapping specific footnotes for additional information. | | | **PostgreSQL** | *all* | ``TEXT`` | | | +--------------------------+ | | | | | **SQL Anywhere** | | | -| | +--------------------------+ | | -| | | **Drizzle** | | | | | +--------------------------+---------+----------------------------------------------------------+ | | | **Oracle** | *all* | ``CLOB`` | | | +--------------------------+ | | diff --git a/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Connection.php b/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Connection.php deleted file mode 100644 index e2b54471312..00000000000 --- a/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Connection.php +++ /dev/null @@ -1,23 +0,0 @@ - - */ -class Connection extends \Doctrine\DBAL\Driver\PDOConnection -{ - /** - * {@inheritdoc} - */ - public function quote($value, $type = ParameterType::STRING) - { - if ($type === ParameterType::BOOLEAN) { - return $value ? 'true' : 'false'; - } - - return parent::quote($value, $type); - } -} diff --git a/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Driver.php b/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Driver.php deleted file mode 100644 index 202dbf80cdd..00000000000 --- a/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Driver.php +++ /dev/null @@ -1,61 +0,0 @@ - - */ -class Driver extends \Doctrine\DBAL\Driver\PDOMySql\Driver -{ - /** - * {@inheritdoc} - */ - public function connect(array $params, $username = null, $password = null, array $driverOptions = []) - { - $conn = new Connection( - $this->constructPdoDsn($params), - $username, - $password, - $driverOptions - ); - - return $conn; - } - - /** - * {@inheritdoc} - */ - public function createDatabasePlatformForVersion($version) - { - return $this->getDatabasePlatform(); - } - - /** - * {@inheritdoc} - */ - public function getDatabasePlatform() - { - return new DrizzlePlatform(); - } - - /** - * {@inheritdoc} - */ - public function getSchemaManager(\Doctrine\DBAL\Connection $conn) - { - return new DrizzleSchemaManager($conn); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'drizzle_pdo_mysql'; - } -} diff --git a/lib/Doctrine/DBAL/DriverManager.php b/lib/Doctrine/DBAL/DriverManager.php index adb8d259934..7c8410c1e3b 100644 --- a/lib/Doctrine/DBAL/DriverManager.php +++ b/lib/Doctrine/DBAL/DriverManager.php @@ -29,7 +29,6 @@ final class DriverManager 'ibm_db2' => 'Doctrine\DBAL\Driver\IBMDB2\DB2Driver', 'pdo_sqlsrv' => 'Doctrine\DBAL\Driver\PDOSqlsrv\Driver', 'mysqli' => 'Doctrine\DBAL\Driver\Mysqli\Driver', - 'drizzle_pdo_mysql' => 'Doctrine\DBAL\Driver\DrizzlePDOMySql\Driver', 'sqlanywhere' => 'Doctrine\DBAL\Driver\SQLAnywhere\Driver', 'sqlsrv' => 'Doctrine\DBAL\Driver\SQLSrv\Driver', ]; @@ -75,7 +74,6 @@ private function __construct() * sqlanywhere * sqlsrv * ibm_db2 (unstable) - * drizzle_pdo_mysql * * OR 'driverClass' that contains the full class name (with namespace) of the * driver class to instantiate. diff --git a/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php b/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php deleted file mode 100644 index c0be1a8a455..00000000000 --- a/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php +++ /dev/null @@ -1,607 +0,0 @@ - - */ -class DrizzlePlatform extends AbstractPlatform -{ - /** - * {@inheritDoc} - */ - public function getName() - { - return 'drizzle'; - } - - /** - * {@inheritDoc} - */ - public function getIdentifierQuoteCharacter() - { - return '`'; - } - - /** - * {@inheritDoc} - */ - public function getConcatExpression() - { - $args = func_get_args(); - - return 'CONCAT(' . join(', ', (array) $args) . ')'; - } - - /** - * {@inheritdoc} - */ - protected function getDateArithmeticIntervalExpression($date, $operator, $interval, $unit) - { - $function = '+' === $operator ? 'DATE_ADD' : 'DATE_SUB'; - - return $function . '(' . $date . ', INTERVAL ' . $interval . ' ' . $unit . ')'; - } - - /** - * {@inheritDoc} - */ - public function getDateDiffExpression($date1, $date2) - { - return 'DATEDIFF(' . $date1 . ', ' . $date2 . ')'; - } - - /** - * {@inheritDoc} - */ - public function getBooleanTypeDeclarationSQL(array $field) - { - return 'BOOLEAN'; - } - - /** - * {@inheritDoc} - */ - public function getIntegerTypeDeclarationSQL(array $field) - { - return 'INT' . $this->_getCommonIntegerTypeDeclarationSQL($field); - } - - /** - * {@inheritDoc} - */ - protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef) - { - $autoinc = ''; - if ( ! empty($columnDef['autoincrement'])) { - $autoinc = ' AUTO_INCREMENT'; - } - - return $autoinc; - } - - /** - * {@inheritDoc} - */ - public function getBigIntTypeDeclarationSQL(array $field) - { - return 'BIGINT' . $this->_getCommonIntegerTypeDeclarationSQL($field); - } - - /** - * {@inheritDoc} - */ - public function getSmallIntTypeDeclarationSQL(array $field) - { - return 'INT' . $this->_getCommonIntegerTypeDeclarationSQL($field); - } - - /** - * {@inheritDoc} - */ - protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) - { - return $length ? 'VARCHAR(' . $length . ')' : 'VARCHAR(255)'; - } - - /** - * {@inheritdoc} - */ - protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed) - { - return 'VARBINARY(' . ($length ?: 255) . ')'; - } - - /** - * {@inheritDoc} - */ - protected function initializeDoctrineTypeMappings() - { - $this->doctrineTypeMapping = [ - 'boolean' => 'boolean', - 'varchar' => 'string', - 'varbinary' => 'binary', - 'integer' => 'integer', - 'blob' => 'blob', - 'decimal' => 'decimal', - 'datetime' => 'datetime', - 'date' => 'date', - 'time' => 'time', - 'text' => 'text', - 'timestamp' => 'datetime', - 'double' => 'float', - 'bigint' => 'bigint', - ]; - } - - /** - * {@inheritDoc} - */ - public function getClobTypeDeclarationSQL(array $field) - { - return 'TEXT'; - } - - /** - * {@inheritDoc} - */ - public function getBlobTypeDeclarationSQL(array $field) - { - return 'BLOB'; - } - - /** - * {@inheritDoc} - */ - public function getCreateDatabaseSQL($name) - { - return 'CREATE DATABASE ' . $name; - } - - /** - * {@inheritDoc} - */ - public function getDropDatabaseSQL($name) - { - return 'DROP DATABASE ' . $name; - } - - /** - * {@inheritDoc} - */ - protected function _getCreateTableSQL($tableName, array $columns, array $options = []) - { - $queryFields = $this->getColumnDeclarationListSQL($columns); - - if (isset($options['uniqueConstraints']) && ! empty($options['uniqueConstraints'])) { - foreach ($options['uniqueConstraints'] as $name => $definition) { - $queryFields .= ', ' . $this->getUniqueConstraintDeclarationSQL($name, $definition); - } - } - - // add all indexes - if (isset($options['indexes']) && ! empty($options['indexes'])) { - foreach ($options['indexes'] as $index => $definition) { - $queryFields .= ', ' . $this->getIndexDeclarationSQL($index, $definition); - } - } - - // attach all primary keys - if (isset($options['primary']) && ! empty($options['primary'])) { - $keyColumns = array_unique(array_values($options['primary'])); - $queryFields .= ', PRIMARY KEY(' . implode(', ', $keyColumns) . ')'; - } - - $query = 'CREATE '; - - if (!empty($options['temporary'])) { - $query .= 'TEMPORARY '; - } - - $query .= 'TABLE ' . $tableName . ' (' . $queryFields . ') '; - $query .= $this->buildTableOptions($options); - $query .= $this->buildPartitionOptions($options); - - $sql[] = $query; - - if (isset($options['foreignKeys'])) { - foreach ((array) $options['foreignKeys'] as $definition) { - $sql[] = $this->getCreateForeignKeySQL($definition, $tableName); - } - } - - return $sql; - } - - /** - * Build SQL for table options - * - * @param array $options - * - * @return string - */ - private function buildTableOptions(array $options) - { - if (isset($options['table_options'])) { - return $options['table_options']; - } - - $tableOptions = []; - - // Collate - if ( ! isset($options['collate'])) { - $options['collate'] = 'utf8_unicode_ci'; - } - - $tableOptions[] = sprintf('COLLATE %s', $options['collate']); - - // Engine - if ( ! isset($options['engine'])) { - $options['engine'] = 'InnoDB'; - } - - $tableOptions[] = sprintf('ENGINE = %s', $options['engine']); - - // Auto increment - if (isset($options['auto_increment'])) { - $tableOptions[] = sprintf('AUTO_INCREMENT = %s', $options['auto_increment']); - } - - // Comment - if (isset($options['comment'])) { - $comment = trim($options['comment'], " '"); - - $tableOptions[] = sprintf("COMMENT = %s ", $this->quoteStringLiteral($comment)); - } - - // Row format - if (isset($options['row_format'])) { - $tableOptions[] = sprintf('ROW_FORMAT = %s', $options['row_format']); - } - - return implode(' ', $tableOptions); - } - - /** - * Build SQL for partition options. - * - * @param array $options - * - * @return string - */ - private function buildPartitionOptions(array $options) - { - return (isset($options['partition_options'])) - ? ' ' . $options['partition_options'] - : ''; - } - - /** - * {@inheritDoc} - */ - public function getListDatabasesSQL() - { - return "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE CATALOG_NAME='LOCAL'"; - } - - /** - * {@inheritDoc} - */ - protected function getReservedKeywordsClass() - { - return Keywords\DrizzleKeywords::class; - } - - /** - * {@inheritDoc} - */ - public function getListTablesSQL() - { - return "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE' AND TABLE_SCHEMA=DATABASE()"; - } - - /** - * {@inheritDoc} - */ - public function getListTableColumnsSQL($table, $database = null) - { - if ($database) { - $database = "'" . $database . "'"; - } else { - $database = 'DATABASE()'; - } - - return "SELECT COLUMN_NAME, DATA_TYPE, COLUMN_COMMENT, IS_NULLABLE, IS_AUTO_INCREMENT, CHARACTER_MAXIMUM_LENGTH, COLUMN_DEFAULT," . - " NUMERIC_PRECISION, NUMERIC_SCALE, COLLATION_NAME" . - " FROM DATA_DICTIONARY.COLUMNS" . - " WHERE TABLE_SCHEMA=" . $database . " AND TABLE_NAME = '" . $table . "'"; - } - - /** - * {@inheritDoc} - */ - public function getListTableForeignKeysSQL($table, $database = null) - { - if ($database) { - $database = "'" . $database . "'"; - } else { - $database = 'DATABASE()'; - } - - return "SELECT CONSTRAINT_NAME, CONSTRAINT_COLUMNS, REFERENCED_TABLE_NAME, REFERENCED_TABLE_COLUMNS, UPDATE_RULE, DELETE_RULE" . - " FROM DATA_DICTIONARY.FOREIGN_KEYS" . - " WHERE CONSTRAINT_SCHEMA=" . $database . " AND CONSTRAINT_TABLE='" . $table . "'"; - } - - /** - * {@inheritDoc} - */ - public function getListTableIndexesSQL($table, $database = null) - { - if ($database) { - $database = "'" . $database . "'"; - } else { - $database = 'DATABASE()'; - } - - return "SELECT INDEX_NAME AS 'key_name', COLUMN_NAME AS 'column_name', IS_USED_IN_PRIMARY AS 'primary', IS_UNIQUE=0 AS 'non_unique'" . - " FROM DATA_DICTIONARY.INDEX_PARTS" . - " WHERE TABLE_SCHEMA=" . $database . " AND TABLE_NAME='" . $table . "'"; - } - - /** - * {@inheritDoc} - */ - public function prefersIdentityColumns() - { - return true; - } - - /** - * {@inheritDoc} - */ - public function supportsIdentityColumns() - { - return true; - } - - /** - * {@inheritDoc} - */ - public function supportsInlineColumnComments() - { - return true; - } - - /** - * {@inheritDoc} - */ - public function supportsViews() - { - return false; - } - - /** - * {@inheritdoc} - */ - public function supportsColumnCollation() - { - return true; - } - - /** - * {@inheritDoc} - */ - public function getDropIndexSQL($index, $table=null) - { - if ($index instanceof Index) { - $indexName = $index->getQuotedName($this); - } elseif (is_string($index)) { - $indexName = $index; - } else { - throw new \InvalidArgumentException('DrizzlePlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.'); - } - - if ($table instanceof Table) { - $table = $table->getQuotedName($this); - } elseif (!is_string($table)) { - throw new \InvalidArgumentException('DrizzlePlatform::getDropIndexSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'); - } - - if ($index instanceof Index && $index->isPrimary()) { - // drizzle primary keys are always named "PRIMARY", - // so we cannot use them in statements because of them being keyword. - return $this->getDropPrimaryKeySQL($table); - } - - return 'DROP INDEX ' . $indexName . ' ON ' . $table; - } - - /** - * {@inheritDoc} - */ - protected function getDropPrimaryKeySQL($table) - { - return 'ALTER TABLE ' . $table . ' DROP PRIMARY KEY'; - } - - /** - * {@inheritDoc} - */ - public function getDateTimeTypeDeclarationSQL(array $fieldDeclaration) - { - if (isset($fieldDeclaration['version']) && $fieldDeclaration['version'] == true) { - return 'TIMESTAMP'; - } - - return 'DATETIME'; - } - - /** - * {@inheritDoc} - */ - public function getTimeTypeDeclarationSQL(array $fieldDeclaration) - { - return 'TIME'; - } - - /** - * {@inheritDoc} - */ - public function getDateTypeDeclarationSQL(array $fieldDeclaration) - { - return 'DATE'; - } - - /** - * {@inheritDoc} - */ - public function getAlterTableSQL(TableDiff $diff) - { - $columnSql = []; - $queryParts = []; - - if ($diff->newName !== false) { - $queryParts[] = 'RENAME TO ' . $diff->getNewName()->getQuotedName($this); - } - - foreach ($diff->addedColumns as $column) { - if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { - continue; - } - - $columnArray = $column->toArray(); - $columnArray['comment'] = $this->getColumnComment($column); - $queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); - } - - foreach ($diff->removedColumns as $column) { - if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) { - continue; - } - - $queryParts[] = 'DROP ' . $column->getQuotedName($this); - } - - foreach ($diff->changedColumns as $columnDiff) { - if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { - continue; - } - - /* @var $columnDiff \Doctrine\DBAL\Schema\ColumnDiff */ - $column = $columnDiff->column; - $columnArray = $column->toArray(); - - // Do not generate column alteration clause if type is binary and only fixed property has changed. - // Drizzle only supports binary type columns with variable length. - // Avoids unnecessary table alteration statements. - if ($columnArray['type'] instanceof BinaryType && - $columnDiff->hasChanged('fixed') && - count($columnDiff->changedProperties) === 1 - ) { - continue; - } - - $columnArray['comment'] = $this->getColumnComment($column); - $queryParts[] = 'CHANGE ' . ($columnDiff->getOldColumnName()->getQuotedName($this)) . ' ' - . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); - } - - foreach ($diff->renamedColumns as $oldColumnName => $column) { - if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) { - continue; - } - - $oldColumnName = new Identifier($oldColumnName); - - $columnArray = $column->toArray(); - $columnArray['comment'] = $this->getColumnComment($column); - $queryParts[] = 'CHANGE ' . $oldColumnName->getQuotedName($this) . ' ' - . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); - } - - $sql = []; - $tableSql = []; - - if ( ! $this->onSchemaAlterTable($diff, $tableSql)) { - if (count($queryParts) > 0) { - $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) . ' ' . implode(", ", $queryParts); - } - $sql = array_merge( - $this->getPreAlterTableIndexForeignKeySQL($diff), - $sql, - $this->getPostAlterTableIndexForeignKeySQL($diff) - ); - } - - return array_merge($sql, $tableSql, $columnSql); - } - - /** - * {@inheritDoc} - */ - public function getDropTemporaryTableSQL($table) - { - if ($table instanceof Table) { - $table = $table->getQuotedName($this); - } elseif (!is_string($table)) { - throw new \InvalidArgumentException('getDropTableSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'); - } - - return 'DROP TEMPORARY TABLE ' . $table; - } - - /** - * {@inheritDoc} - */ - public function convertBooleans($item) - { - if (is_array($item)) { - foreach ($item as $key => $value) { - if (is_bool($value) || is_numeric($item)) { - $item[$key] = ($value) ? 'true' : 'false'; - } - } - } elseif (is_bool($item) || is_numeric($item)) { - $item = ($item) ? 'true' : 'false'; - } - - return $item; - } - - /** - * {@inheritDoc} - */ - public function getLocateExpression($str, $substr, $startPos = false) - { - if ($startPos == false) { - return 'LOCATE(' . $substr . ', ' . $str . ')'; - } - - return 'LOCATE(' . $substr . ', ' . $str . ', '.$startPos.')'; - } - - /** - * {@inheritDoc} - */ - public function getGuidExpression() - { - return 'UUID()'; - } - - /** - * {@inheritDoc} - */ - public function getRegexpExpression() - { - return 'RLIKE'; - } -} diff --git a/lib/Doctrine/DBAL/Platforms/Keywords/DrizzleKeywords.php b/lib/Doctrine/DBAL/Platforms/Keywords/DrizzleKeywords.php deleted file mode 100644 index 0c121f784a7..00000000000 --- a/lib/Doctrine/DBAL/Platforms/Keywords/DrizzleKeywords.php +++ /dev/null @@ -1,328 +0,0 @@ - - */ -class DrizzleKeywords extends KeywordList -{ - /** - * {@inheritdoc} - */ - public function getName() - { - return 'drizzle'; - } - - /** - * {@inheritdoc} - */ - protected function getKeywords() - { - return [ - 'ABS', - 'ALL', - 'ALLOCATE', - 'ALTER', - 'AND', - 'ANY', - 'ARE', - 'ARRAY', - 'AS', - 'ASENSITIVE', - 'ASYMMETRIC', - 'AT', - 'ATOMIC', - 'AUTHORIZATION', - 'AVG', - 'BEGIN', - 'BETWEEN', - 'BIGINT', - 'BINARY', - 'BLOB', - 'BOOLEAN', - 'BOTH', - 'BY', - 'CALL', - 'CALLED', - 'CARDINALITY', - 'CASCADED', - 'CASE', - 'CAST', - 'CEIL', - 'CEILING', - 'CHAR', - 'CHARACTER', - 'CHARACTER_LENGTH', - 'CHAR_LENGTH', - 'CHECK', - 'CLOB', - 'CLOSE', - 'COALESCE', - 'COLLATE', - 'COLLECT', - 'COLUMN', - 'COMMIT', - 'CONDITION', - 'CONNECT', - 'CONSTRAINT', - 'CONVERT', - 'CORR', - 'CORRESPONDING', - 'COUNT', - 'COVAR_POP', - 'COVAR_SAMP', - 'CREATE', - 'CROSS', - 'CUBE', - 'CUME_DIST', - 'CURRENT', - 'CURRENT_DATE', - 'CURRENT_DEFAULT_TRANSFORM_GROUP', - 'CURRENT_PATH', - 'CURRENT_ROLE', - 'CURRENT_TIME', - 'CURRENT_TIMESTAMP', - 'CURRENT_TRANSFORM_GROUP_FOR_TYPE', - 'CURRENT_USER', - 'CURSOR', - 'CYCLE', - 'DATE', - 'DAY', - 'DEALLOCATE', - 'DEC', - 'DECIMAL', - 'DECLARE', - 'DEFAULT', - 'DELETE', - 'DENSE_RANK', - 'DEREF', - 'DESCRIBE', - 'DETERMINISTIC', - 'DISCONNECT', - 'DISTINCT', - 'DOUBLE', - 'DROP', - 'DYNAMIC', - 'EACH', - 'ELEMENT', - 'ELSE', - 'END', - 'ESCAPE', - 'EVERY', - 'EXCEPT', - 'EXEC', - 'EXECUTE', - 'EXISTS', - 'EXP', - 'EXTERNAL', - 'EXTRACT', - 'FALSE', - 'FETCH', - 'FILTER', - 'FLOAT', - 'FLOOR', - 'FOR', - 'FOREIGN', - 'FREE', - 'FROM', - 'FULL', - 'FUNCTION', - 'FUSION', - 'GET', - 'GLOBAL', - 'GRANT', - 'GROUP', - 'GROUPING', - 'HAVING', - 'HOLD', - 'HOUR', - 'IDENTITY', - 'IN', - 'INDICATOR', - 'INNER', - 'INOUT', - 'INSENSITIVE', - 'INSERT', - 'INT', - 'INTEGER', - 'INTERSECT', - 'INTERSECTION', - 'INTERVAL', - 'INTO', - 'IS', - 'JOIN', - 'LANGUAGE', - 'LARGE', - 'LATERAL', - 'LEADING', - 'LEFT', - 'LIKE', - 'LN', - 'LOCAL', - 'LOCALTIME', - 'LOCALTIMESTAMP', - 'LOWER', - 'MATCH', - 'MAX', - 'MEMBER', - 'MERGE', - 'METHOD', - 'MIN', - 'MINUTE', - 'MOD', - 'MODIFIES', - 'MODULE', - 'MONTH', - 'MULTISET', - 'NATIONAL', - 'NATURAL', - 'NCHAR', - 'NCLOB', - 'NEW', - 'NO', - 'NONE', - 'NORMALIZE', - 'NOT', - 'NULL_SYM', - 'NULLIF', - 'NUMERIC', - 'OCTET_LENGTH', - 'OF', - 'OLD', - 'ON', - 'ONLY', - 'OPEN', - 'OR', - 'ORDER', - 'OUT', - 'OUTER', - 'OVER', - 'OVERLAPS', - 'OVERLAY', - 'PARAMETER', - 'PARTITION', - 'PERCENTILE_CONT', - 'PERCENTILE_DISC', - 'PERCENT_RANK', - 'POSITION', - 'POWER', - 'PRECISION', - 'PREPARE', - 'PRIMARY', - 'PROCEDURE', - 'RANGE', - 'RANK', - 'READS', - 'REAL', - 'RECURSIVE', - 'REF', - 'REFERENCES', - 'REFERENCING', - 'REGR_AVGX', - 'REGR_AVGY', - 'REGR_COUNT', - 'REGR_INTERCEPT', - 'REGR_R2', - 'REGR_SLOPE', - 'REGR_SXX', - 'REGR_SXY', - 'REGR_SYY', - 'RELEASE', - 'RESULT', - 'RETURN', - 'RETURNS', - 'REVOKE', - 'RIGHT', - 'ROLLBACK', - 'ROLLUP', - 'ROW', - 'ROWS', - 'ROW_NUMBER', - 'SAVEPOINT', - 'SCOPE', - 'SCROLL', - 'SEARCH', - 'SECOND', - 'SELECT', - 'SENSITIVE', - 'SESSION_USER', - 'SET', - 'SIMILAR', - 'SMALLINT', - 'SOME', - 'SPECIFIC', - 'SPECIFICTYPE', - 'SQL', - 'SQLEXCEPTION', - 'SQLSTATE', - 'SQLWARNING', - 'SQRT', - 'START', - 'STATIC', - 'STDDEV_POP', - 'STDDEV_SAMP', - 'SUBMULTISET', - 'SUBSTRING', - 'SUM', - 'SYMMETRIC', - 'SYSTEM', - 'SYSTEM_USER', - 'TABLE', - 'TABLESAMPLE', - 'THEN', - 'TIME', - 'TIMESTAMP', - 'TIMEZONE_HOUR', - 'TIMEZONE_MINUTE', - 'TO', - 'TRAILING', - 'TRANSLATE', - 'TRANSLATION', - 'TREAT', - 'TRIGGER', - 'TRIM', - 'TRUE', - 'UESCAPE', - 'UNION', - 'UNIQUE', - 'UNKNOWN', - 'UNNEST', - 'UPDATE', - 'UPPER', - 'USER', - 'USING', - 'VALUE', - 'VALUES', - 'VARCHAR', - 'VARYING', - 'VAR_POP', - 'VAR_SAMP', - 'WHEN', - 'WHENEVER', - 'WHERE', - 'WIDTH_BUCKET', - 'WINDOW', - 'WITH', - 'WITHIN', - 'WITHOUT', - 'XML', - 'XMLAGG', - 'XMLATTRIBUTES', - 'XMLBINARY', - 'XMLCOMMENT', - 'XMLCONCAT', - 'XMLELEMENT', - 'XMLFOREST', - 'XMLNAMESPACES', - 'XMLPARSE', - 'XMLPI', - 'XMLROOT', - 'XMLSERIALIZE', - 'YEAR', - ]; - } -} diff --git a/lib/Doctrine/DBAL/Portability/Connection.php b/lib/Doctrine/DBAL/Portability/Connection.php index 605f46f0a1c..225790857e7 100644 --- a/lib/Doctrine/DBAL/Portability/Connection.php +++ b/lib/Doctrine/DBAL/Portability/Connection.php @@ -25,7 +25,6 @@ class Connection extends \Doctrine\DBAL\Connection const PORTABILITY_POSTGRESQL = 13; const PORTABILITY_SQLITE = 13; const PORTABILITY_OTHERVENDORS = 12; - const PORTABILITY_DRIZZLE = 13; const PORTABILITY_SQLANYWHERE = 13; const PORTABILITY_SQLSRV = 13; @@ -54,8 +53,6 @@ public function connect() $params['portability'] = $params['portability'] & self::PORTABILITY_POSTGRESQL; } elseif ($this->getDatabasePlatform()->getName() === "sqlite") { $params['portability'] = $params['portability'] & self::PORTABILITY_SQLITE; - } elseif ($this->getDatabasePlatform()->getName() === "drizzle") { - $params['portability'] = $params['portability'] & self::PORTABILITY_DRIZZLE; } elseif ($this->getDatabasePlatform()->getName() === 'sqlanywhere') { $params['portability'] = $params['portability'] & self::PORTABILITY_SQLANYWHERE; } elseif ($this->getDatabasePlatform()->getName() === 'db2') { diff --git a/lib/Doctrine/DBAL/Schema/DrizzleSchemaManager.php b/lib/Doctrine/DBAL/Schema/DrizzleSchemaManager.php deleted file mode 100644 index 9196b043380..00000000000 --- a/lib/Doctrine/DBAL/Schema/DrizzleSchemaManager.php +++ /dev/null @@ -1,102 +0,0 @@ - - */ -class DrizzleSchemaManager extends AbstractSchemaManager -{ - /** - * {@inheritdoc} - */ - protected function _getPortableTableColumnDefinition($tableColumn) - { - $dbType = strtolower($tableColumn['DATA_TYPE']); - - $type = $this->_platform->getDoctrineTypeMapping($dbType); - $type = $this->extractDoctrineTypeFromComment($tableColumn['COLUMN_COMMENT'], $type); - $tableColumn['COLUMN_COMMENT'] = $this->removeDoctrineTypeFromComment($tableColumn['COLUMN_COMMENT'], $type); - - $options = [ - 'notnull' => !(bool) $tableColumn['IS_NULLABLE'], - 'length' => (int) $tableColumn['CHARACTER_MAXIMUM_LENGTH'], - 'default' => $tableColumn['COLUMN_DEFAULT'] ?? null, - 'autoincrement' => (bool) $tableColumn['IS_AUTO_INCREMENT'], - 'scale' => (int) $tableColumn['NUMERIC_SCALE'], - 'precision' => (int) $tableColumn['NUMERIC_PRECISION'], - 'comment' => isset($tableColumn['COLUMN_COMMENT']) && '' !== $tableColumn['COLUMN_COMMENT'] - ? $tableColumn['COLUMN_COMMENT'] - : null, - ]; - - $column = new Column($tableColumn['COLUMN_NAME'], Type::getType($type), $options); - - if ( ! empty($tableColumn['COLLATION_NAME'])) { - $column->setPlatformOption('collation', $tableColumn['COLLATION_NAME']); - } - - return $column; - } - - /** - * {@inheritdoc} - */ - protected function _getPortableDatabaseDefinition($database) - { - return $database['SCHEMA_NAME']; - } - - /** - * {@inheritdoc} - */ - protected function _getPortableTableDefinition($table) - { - return $table['TABLE_NAME']; - } - - /** - * {@inheritdoc} - */ - public function _getPortableTableForeignKeyDefinition($tableForeignKey) - { - $columns = []; - foreach (explode(',', $tableForeignKey['CONSTRAINT_COLUMNS']) as $value) { - $columns[] = trim($value, ' `'); - } - - $refColumns = []; - foreach (explode(',', $tableForeignKey['REFERENCED_TABLE_COLUMNS']) as $value) { - $refColumns[] = trim($value, ' `'); - } - - return new ForeignKeyConstraint( - $columns, - $tableForeignKey['REFERENCED_TABLE_NAME'], - $refColumns, - $tableForeignKey['CONSTRAINT_NAME'], - [ - 'onUpdate' => $tableForeignKey['UPDATE_RULE'], - 'onDelete' => $tableForeignKey['DELETE_RULE'], - ] - ); - } - - /** - * {@inheritdoc} - */ - protected function _getPortableTableIndexesList($tableIndexes, $tableName = null) - { - $indexes = []; - foreach ($tableIndexes as $k) { - $k['primary'] = (boolean) $k['primary']; - $indexes[] = $k; - } - - return parent::_getPortableTableIndexesList($indexes, $tableName); - } -} diff --git a/tests/Doctrine/Tests/DBAL/Driver/DrizzlePDOMySql/DriverTest.php b/tests/Doctrine/Tests/DBAL/Driver/DrizzlePDOMySql/DriverTest.php deleted file mode 100644 index 004043c2051..00000000000 --- a/tests/Doctrine/Tests/DBAL/Driver/DrizzlePDOMySql/DriverTest.php +++ /dev/null @@ -1,46 +0,0 @@ -driver->getName()); - } - - public function testThrowsExceptionOnCreatingDatabasePlatformsForInvalidVersion() - { - $this->markTestSkipped('This test does not work on Drizzle as it is not version aware.'); - } - - protected function createDriver() - { - return new Driver(); - } - - protected function createPlatform() - { - return new DrizzlePlatform(); - } - - protected function createSchemaManager(Connection $connection) - { - return new DrizzleSchemaManager($connection); - } - - protected function getDatabasePlatformsForVersions() : array - { - return [ - ['foo', 'Doctrine\DBAL\Platforms\DrizzlePlatform'], - ['bar', 'Doctrine\DBAL\Platforms\DrizzlePlatform'], - ['baz', 'Doctrine\DBAL\Platforms\DrizzlePlatform'], - ]; - } -} diff --git a/tests/Doctrine/Tests/DBAL/DriverManagerTest.php b/tests/Doctrine/Tests/DBAL/DriverManagerTest.php index 473c0ac0206..3f25521e98a 100644 --- a/tests/Doctrine/Tests/DBAL/DriverManagerTest.php +++ b/tests/Doctrine/Tests/DBAL/DriverManagerTest.php @@ -3,7 +3,6 @@ namespace Doctrine\Tests\DBAL; use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Driver\DrizzlePDOMySql\Driver as DrizzlePDOMySqlDriver; use Doctrine\DBAL\Driver\PDOMySQL\Driver as PDOMySQLDriver; use Doctrine\DBAL\Driver\PDOSqlite\Driver as PDOSqliteDriver; use Doctrine\DBAL\Driver\SQLSrv\Driver as SQLSrvDriver; @@ -271,17 +270,17 @@ public function databaseUrls() ], ], 'simple URL with fallthrough scheme containing underscores fails' => [ - 'drizzle_pdo_mysql://foo:bar@localhost/baz', + 'pdo_mysql://foo:bar@localhost/baz', false, ], 'simple URL with fallthrough scheme containing dashes works' => [ - 'drizzle-pdo-mysql://foo:bar@localhost/baz', + 'pdo-mysql://foo:bar@localhost/baz', [ 'user' => 'foo', 'password' => 'bar', 'host' => 'localhost', 'dbname' => 'baz', - 'driver' => DrizzlePDOMySqlDriver::class, + 'driver' => PDOMySQLDriver::class, ], ], 'simple URL with percent encoding' => [ diff --git a/tests/Doctrine/Tests/DBAL/Functional/ExceptionTest.php b/tests/Doctrine/Tests/DBAL/Functional/ExceptionTest.php index 277e020392f..1a848b85451 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/ExceptionTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/ExceptionTest.php @@ -323,10 +323,6 @@ public function testConnectionException($params) $this->markTestSkipped("Only skipped if platform is not sqlite"); } - if ($this->_conn->getDatabasePlatform()->getName() == 'drizzle') { - $this->markTestSkipped("Drizzle does not always support authentication"); - } - if ($this->_conn->getDatabasePlatform()->getName() == 'postgresql' && isset($params['password'])) { $this->markTestSkipped("Does not work on Travis"); } diff --git a/tests/Doctrine/Tests/DBAL/Functional/Schema/DrizzleSchemaManagerTest.php b/tests/Doctrine/Tests/DBAL/Functional/Schema/DrizzleSchemaManagerTest.php deleted file mode 100644 index 5b63b363a51..00000000000 --- a/tests/Doctrine/Tests/DBAL/Functional/Schema/DrizzleSchemaManagerTest.php +++ /dev/null @@ -1,47 +0,0 @@ -addColumn('id', 'integer'); - $table->addColumn('column_varbinary', 'binary', array()); - $table->addColumn('column_binary', 'binary', array('fixed' => true)); - $table->setPrimaryKey(array('id')); - - $this->_sm->createTable($table); - - $table = $this->_sm->listTableDetails($tableName); - - self::assertInstanceOf('Doctrine\DBAL\Types\BinaryType', $table->getColumn('column_varbinary')->getType()); - self::assertFalse($table->getColumn('column_varbinary')->getFixed()); - - self::assertInstanceOf('Doctrine\DBAL\Types\BinaryType', $table->getColumn('column_binary')->getType()); - self::assertFalse($table->getColumn('column_binary')->getFixed()); - } - - public function testColumnCollation() - { - $table = new Table('test_collation'); - $table->addOption('collate', $collation = 'utf8_unicode_ci'); - $table->addColumn('id', 'integer'); - $table->addColumn('text', 'text'); - $table->addColumn('foo', 'text')->setPlatformOption('collation', 'utf8_swedish_ci'); - $table->addColumn('bar', 'text')->setPlatformOption('collation', 'utf8_general_ci'); - $this->_sm->dropAndCreateTable($table); - - $columns = $this->_sm->listTableColumns('test_collation'); - - self::assertArrayNotHasKey('collation', $columns['id']->getPlatformOptions()); - self::assertEquals('utf8_unicode_ci', $columns['text']->getPlatformOption('collation')); - self::assertEquals('utf8_swedish_ci', $columns['foo']->getPlatformOption('collation')); - self::assertEquals('utf8_general_ci', $columns['bar']->getPlatformOption('collation')); - } -}