Skip to content

Commit

Permalink
Merge branch '4.0.x' into 4.1.x
Browse files Browse the repository at this point in the history
* 4.0.x:
  CI: Update MariaDB versions (#6426)
  CI MariaDB: add 11.4, remove 11.0 (#6432)
  Display warnings when running PHPUnit in CI (#6431)
  Fix typo in the portability documentation (#6430)
  Fix MariaDB fetching of default table character-set (#6361) (#6425)
  Fix the portability documentation (#6429)
  Update tests/Platforms/AbstractPlatformTestCase.php
  Update tests/Platforms/AbstractPlatformTestCase.php
  add test
  Fix: Skip type comparison if disableTypeComments is true
  • Loading branch information
derrabus committed Jun 14, 2024
2 parents ff0dab7 + 8edbce7 commit 5caaee4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
if: "${{ matrix.extension == 'sqlite3' }}"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage.xml"
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage.xml --display-warnings"

- name: "Upload coverage file"
uses: "actions/upload-artifact@v4"
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
composer-options: "--ignore-platform-req=php+"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit -c ci/github/phpunit/oci8${{ matrix.oracle-version < 23 && '-21' || '' }}.xml --coverage-clover=coverage.xml"
run: "vendor/bin/phpunit -c ci/github/phpunit/oci8${{ matrix.oracle-version < 23 && '-21' || '' }}.xml --coverage-clover=coverage.xml --display-warnings"

- name: "Upload coverage file"
uses: "actions/upload-artifact@v4"
Expand Down Expand Up @@ -198,7 +198,7 @@ jobs:
composer-options: "--ignore-platform-req=php+"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit -c ci/github/phpunit/pdo_oci${{ matrix.oracle-version < 23 && '-21' || '' }}.xml --coverage-clover=coverage.xml"
run: "vendor/bin/phpunit -c ci/github/phpunit/pdo_oci${{ matrix.oracle-version < 23 && '-21' || '' }}.xml --coverage-clover=coverage.xml --display-warnings"

- name: "Upload coverage file"
uses: "actions/upload-artifact@v4"
Expand Down Expand Up @@ -262,7 +262,7 @@ jobs:
composer-options: "--ignore-platform-req=php+"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage.xml"
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage.xml --display-warnings"

- name: "Upload coverage file"
uses: "actions/upload-artifact@v4"
Expand All @@ -285,19 +285,19 @@ jobs:
- "10.5" # LTS (Jun 2025)
- "10.6" # LTS (Jul 2026)
- "10.11" # LTS (Feb 2028)
- "11.0" # STS (Jun 2024)
- "11.1" # STS (Aug 2024)
- "11.2" # STS (Nov 2024)
- "11.3" # STS (Feb 2025)
- "11.4" # LTS (May 2029)
extension:
- "mysqli"
- "pdo_mysql"
include:
- php-version: "8.2"
mariadb-version: "11.2"
mariadb-version: "11.4"
extension: "mysqli"
- php-version: "8.3"
mariadb-version: "11.2"
mariadb-version: "11.4"
extension: "pdo_mysql"

services:
Expand All @@ -308,7 +308,7 @@ jobs:
MYSQL_DATABASE: "doctrine_tests"

options: >-
--health-cmd "mariadb-admin ping --silent || mysqladmin ping --silent"
--health-cmd "healthcheck.sh --connect --innodb_initialized || mysqladmin ping --protocol tcp --silent"
ports:
- "3306:3306"
Expand All @@ -333,7 +333,7 @@ jobs:
composer-options: "--ignore-platform-req=php+"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage.xml"
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage.xml --display-warnings"

- name: "Upload coverage file"
uses: "actions/upload-artifact@v4"
Expand Down Expand Up @@ -417,7 +417,7 @@ jobs:
if: "${{ endsWith(matrix.config-file-suffix, 'tls') }}"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}${{ matrix.config-file-suffix }}.xml --coverage-clover=coverage.xml"
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}${{ matrix.config-file-suffix }}.xml --coverage-clover=coverage.xml --display-warnings"

- name: "Upload coverage file"
uses: "actions/upload-artifact@v4"
Expand Down Expand Up @@ -484,7 +484,7 @@ jobs:
composer-options: "--ignore-platform-req=php+"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage.xml"
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage.xml --display-warnings"

- name: "Upload coverage file"
uses: "actions/upload-artifact@v4"
Expand Down Expand Up @@ -555,7 +555,7 @@ jobs:
composer-options: "--ignore-platform-req=php+"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit -c ci/github/phpunit/ibm_db2.xml --coverage-clover=coverage.xml"
run: "vendor/bin/phpunit -c ci/github/phpunit/ibm_db2.xml --coverage-clover=coverage.xml --display-warnings"

- name: "Upload coverage file"
uses: "actions/upload-artifact@v4"
Expand Down Expand Up @@ -590,7 +590,7 @@ jobs:
composer-options: "--prefer-dist"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit -c ci/github/phpunit/pdo_sqlite.xml"
run: "vendor/bin/phpunit -c ci/github/phpunit/pdo_sqlite.xml --display-warnings"

upload_coverage:
name: "Upload coverage to Codecov"
Expand Down
13 changes: 7 additions & 6 deletions docs/en/reference/portability.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,16 @@ Using the following code block in your initialization will:
<?php
use Doctrine\DBAL\ColumnCase;
use Doctrine\DBAL\Configuration;
use Doctrine\DBAL\Portability\Connection as PortableConnection;
use Doctrine\DBAL\Portability\Middleware as PortableMiddleware;
$params = [
// vendor specific configuration
$configuration = new Configuration();
$configuration->setMiddlewares([
// Other middlewares
//...
'wrapperClass' => PortableConnection::class,
'portability' => PortableConnection::PORTABILITY_ALL,
'fetch_case' => ColumnCase::LOWER,
];
new PortableMiddleware(PortableConnection::PORTABILITY_ALL, ColumnCase::LOWER),
]);
This sort of portability handling is pretty expensive because all the result
rows and columns have to be looped inside PHP before being returned to you.
Expand Down
8 changes: 7 additions & 1 deletion src/Schema/MySQLSchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,11 @@ protected function selectForeignKeyColumns(string $databaseName, ?string $tableN
*/
protected function fetchTableOptionsByTable(string $databaseName, ?string $tableName = null): array
{
// MariaDB-10.10.1 added FULL_COLLATION_NAME to the information_schema.COLLATION_CHARACTER_SET_APPLICABILITY.
// A base collation like uca1400_ai_ci can refer to multiple character sets. The value in the
// information_schema.TABLES.TABLE_COLLATION corresponds to the full collation name.
// The MariaDB executable comment syntax with version, /*M!101001, is exclusively executed on
// MariaDB-10.10.1+ servers for backwards compatibility, and compatiblity to MySQL servers.
$sql = <<<'SQL'
SELECT t.TABLE_NAME,
t.ENGINE,
Expand All @@ -470,7 +475,8 @@ protected function fetchTableOptionsByTable(string $databaseName, ?string $table
ccsa.CHARACTER_SET_NAME
FROM information_schema.TABLES t
INNER JOIN information_schema.COLLATION_CHARACTER_SET_APPLICABILITY ccsa
ON ccsa.COLLATION_NAME = t.TABLE_COLLATION
ON /*M!101001 ccsa.FULL_COLLATION_NAME = t.TABLE_COLLATION OR */
ccsa.COLLATION_NAME = t.TABLE_COLLATION
SQL;

$conditions = ['t.TABLE_SCHEMA = ?'];
Expand Down

0 comments on commit 5caaee4

Please sign in to comment.