Skip to content

Commit 5caaee4

Browse files
committed
Merge branch '4.0.x' into 4.1.x
* 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
2 parents ff0dab7 + 8edbce7 commit 5caaee4

File tree

3 files changed

+27
-20
lines changed

3 files changed

+27
-20
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
if: "${{ matrix.extension == 'sqlite3' }}"
8585

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

8989
- name: "Upload coverage file"
9090
uses: "actions/upload-artifact@v4"
@@ -141,7 +141,7 @@ jobs:
141141
composer-options: "--ignore-platform-req=php+"
142142

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

146146
- name: "Upload coverage file"
147147
uses: "actions/upload-artifact@v4"
@@ -198,7 +198,7 @@ jobs:
198198
composer-options: "--ignore-platform-req=php+"
199199

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

203203
- name: "Upload coverage file"
204204
uses: "actions/upload-artifact@v4"
@@ -262,7 +262,7 @@ jobs:
262262
composer-options: "--ignore-platform-req=php+"
263263

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

267267
- name: "Upload coverage file"
268268
uses: "actions/upload-artifact@v4"
@@ -285,19 +285,19 @@ jobs:
285285
- "10.5" # LTS (Jun 2025)
286286
- "10.6" # LTS (Jul 2026)
287287
- "10.11" # LTS (Feb 2028)
288-
- "11.0" # STS (Jun 2024)
289288
- "11.1" # STS (Aug 2024)
290289
- "11.2" # STS (Nov 2024)
291290
- "11.3" # STS (Feb 2025)
291+
- "11.4" # LTS (May 2029)
292292
extension:
293293
- "mysqli"
294294
- "pdo_mysql"
295295
include:
296296
- php-version: "8.2"
297-
mariadb-version: "11.2"
297+
mariadb-version: "11.4"
298298
extension: "mysqli"
299299
- php-version: "8.3"
300-
mariadb-version: "11.2"
300+
mariadb-version: "11.4"
301301
extension: "pdo_mysql"
302302

303303
services:
@@ -308,7 +308,7 @@ jobs:
308308
MYSQL_DATABASE: "doctrine_tests"
309309

310310
options: >-
311-
--health-cmd "mariadb-admin ping --silent || mysqladmin ping --silent"
311+
--health-cmd "healthcheck.sh --connect --innodb_initialized || mysqladmin ping --protocol tcp --silent"
312312
313313
ports:
314314
- "3306:3306"
@@ -333,7 +333,7 @@ jobs:
333333
composer-options: "--ignore-platform-req=php+"
334334

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

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

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

422422
- name: "Upload coverage file"
423423
uses: "actions/upload-artifact@v4"
@@ -484,7 +484,7 @@ jobs:
484484
composer-options: "--ignore-platform-req=php+"
485485

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

489489
- name: "Upload coverage file"
490490
uses: "actions/upload-artifact@v4"
@@ -555,7 +555,7 @@ jobs:
555555
composer-options: "--ignore-platform-req=php+"
556556

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

560560
- name: "Upload coverage file"
561561
uses: "actions/upload-artifact@v4"
@@ -590,7 +590,7 @@ jobs:
590590
composer-options: "--prefer-dist"
591591

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

595595
upload_coverage:
596596
name: "Upload coverage to Codecov"

docs/en/reference/portability.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,16 @@ Using the following code block in your initialization will:
5151
<?php
5252
5353
use Doctrine\DBAL\ColumnCase;
54+
use Doctrine\DBAL\Configuration;
5455
use Doctrine\DBAL\Portability\Connection as PortableConnection;
56+
use Doctrine\DBAL\Portability\Middleware as PortableMiddleware;
5557
56-
$params = [
57-
// vendor specific configuration
58+
$configuration = new Configuration();
59+
$configuration->setMiddlewares([
60+
// Other middlewares
5861
//...
59-
'wrapperClass' => PortableConnection::class,
60-
'portability' => PortableConnection::PORTABILITY_ALL,
61-
'fetch_case' => ColumnCase::LOWER,
62-
];
62+
new PortableMiddleware(PortableConnection::PORTABILITY_ALL, ColumnCase::LOWER),
63+
]);
6364
6465
This sort of portability handling is pretty expensive because all the result
6566
rows and columns have to be looped inside PHP before being returned to you.

src/Schema/MySQLSchemaManager.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,11 @@ protected function selectForeignKeyColumns(string $databaseName, ?string $tableN
460460
*/
461461
protected function fetchTableOptionsByTable(string $databaseName, ?string $tableName = null): array
462462
{
463+
// MariaDB-10.10.1 added FULL_COLLATION_NAME to the information_schema.COLLATION_CHARACTER_SET_APPLICABILITY.
464+
// A base collation like uca1400_ai_ci can refer to multiple character sets. The value in the
465+
// information_schema.TABLES.TABLE_COLLATION corresponds to the full collation name.
466+
// The MariaDB executable comment syntax with version, /*M!101001, is exclusively executed on
467+
// MariaDB-10.10.1+ servers for backwards compatibility, and compatiblity to MySQL servers.
463468
$sql = <<<'SQL'
464469
SELECT t.TABLE_NAME,
465470
t.ENGINE,
@@ -470,7 +475,8 @@ protected function fetchTableOptionsByTable(string $databaseName, ?string $table
470475
ccsa.CHARACTER_SET_NAME
471476
FROM information_schema.TABLES t
472477
INNER JOIN information_schema.COLLATION_CHARACTER_SET_APPLICABILITY ccsa
473-
ON ccsa.COLLATION_NAME = t.TABLE_COLLATION
478+
ON /*M!101001 ccsa.FULL_COLLATION_NAME = t.TABLE_COLLATION OR */
479+
ccsa.COLLATION_NAME = t.TABLE_COLLATION
474480
SQL;
475481

476482
$conditions = ['t.TABLE_SCHEMA = ?'];

0 commit comments

Comments
 (0)