[DBAL-1308] MySQL getListTableForeignKeysSQL Slow for MariaDB Created: 30/Sep/15  Updated: 30/Sep/15

Status: Open
Project: Doctrine DBAL
Component/s: Platforms
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Joe Meyer Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: mariadb, mysql



It appears that MySQL and MariaDB build different query plans for the getListTableForeignKeys() function (see https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php#L183-L198) . MariaDB ends up doing a table scan of the tables instead of using the constraint (possibly because it doesn't exist?). This takes a decent amount of time every time it's run, and causes PHP timeouts when it has to check numerous tables.

See https://github.com/concrete5/concrete5/issues/2994 for more discussion and query plan results.

[DBAL-1305] Misleading Not Unique Alias Error Message in 2.5.2 Release Created: 21/Sep/15  Updated: 29/Sep/15

Status: Open
Project: Doctrine DBAL
Component/s: None
Affects Version/s: 2.5.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: John Madrak Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 2
Labels: None


The recent change to QueryBuilder.php (https://github.com/doctrine/dbal/blob/v2.5.2/lib/Doctrine/DBAL/Query/QueryBuilder.php) that introduced QueryException::notUniqueAlias is causing some issues for us.

We did not have an alias specified for our joins previously (I'm not sure if this was supposed to be supported or not, but it was working as we were using the table names directly) and now that this change is in place the new error is triggered.

Doctrine\DBAL\Query\QueryException: The given alias '' is not unique in FROM and JOIN clause table. The currently registered aliases are: table, .

If the alias is mandatory, perhaps a separate error should be displayed when it's not specified?

Comment by Tung Nguyen [ 29/Sep/15 ]

After updated from 2.5.1 to 2.5.2, this bug appears and I tried to change my "old ok" alias to a random string, but it cannot be fixed. Finally, I had done a rollback to make everything works again.

Generated at Sun Oct 04 21:26:42 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.