ezsystems/ezpublish-kernel — pull request #763 by pspanja (2014-03-03 17:10:28+00:00)
Title: Fix EZP-22359: Legacy storage engine doesn't work with Doctrine's MySQLi driver

This (kind of) resolves https://jira.ez.no/browse/EZP-22359

The problem is that mysqli driver supports only positional placeholders, and Zeta Database uses only named placeholders.
While we do not use specific placeholder names at all in out codebase, the problem is not simple to fix, because it is possible for placeholders to be ordered differently than they appear in the query, for example something like:

```sql
UPDATE table SET column1 = :placeholder2 WHERE column2 = :placeholder1
```

This is often the case with sub-queries, one example can be found here: https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/Core/Persistence/Legacy/Content/Location/Gateway/DoctrineDatabase.php#L1346

To account for this a mapping of placeholders to their index in query is required, however that affects performance too much and IMO is not acceptable.

AFAICS Doctrine does not handle this either, so for mysqli named placeholders will not work and positional must be used instead, with the special care on the order of binding.

Depending how much we want mysqli support, we could rewrite these queries so that simpler binding for mysqli can be implemented. My opinion is that it is not worthwhile, and I would really go with won't fix here.