[PR #9405] Fix "Illegal mix of collations" in MultiTableDeleteExecutor - Take 2 #11593

Open
opened 2026-01-22 16:11:15 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/9405

State: closed
Merged: No


When database tables use a collation that's not the default database one, MultiTableDeleteExecutor fails with this error:

In AbstractMySQLDriver.php line 128:
                                                                                                                                                    
  [Doctrine\DBAL\Exception\DriverException]                                                                                                         
  An exception occurred while executing 'DELETE FROM MessengerTaskProcesses WHERE (id) IN (SELECT id FROM MessengerProcesses_id_tmp)':              
                                                                                                                                                    
  SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT) for operation '='

This issue should be fixed by using the configured charset/collation.

Let's first add a test that detects the issue: I'll then update this PR to fix it.

PS: Supersedes #9370

**Original Pull Request:** https://github.com/doctrine/orm/pull/9405 **State:** closed **Merged:** No --- When database tables use a collation that's not the default database one, MultiTableDeleteExecutor fails with this error: ``` In AbstractMySQLDriver.php line 128: [Doctrine\DBAL\Exception\DriverException] An exception occurred while executing 'DELETE FROM MessengerTaskProcesses WHERE (id) IN (SELECT id FROM MessengerProcesses_id_tmp)': SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT) for operation '=' ``` This issue should be fixed by using the configured charset/collation. Let's first add a test that detects the issue: I'll then update this PR to fix it. PS: Supersedes #9370
admin added the pull-request label 2026-01-22 16:11:15 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#11593