Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Invalid
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Security Level: All
-
Labels:None
Description
This issue is created automatically through a Github pull request on behalf of gigablah:
Url: https://github.com/doctrine/dbal/pull/277
Message:
Presently, it's possible to do this using QueryBuilder:
```php
$qb->select('u.*')
->from('users', 'u')
->addOrderBy('u.name', 'ASC')
->addOrderBy('u.name', 'ASC'); // duplicate
```
Which produces:
```sql
SELECT u.* FROM users u ORDER BY u.name ASC, u.name ASC
```
This patch removes duplicates from the `SELECT`, `SET`, `ORDER BY` and `GROUP BY` parts during SQL generation (there's already logic that removes duplicate `FROM` parts).
I've added test cases for each affected keyword as well.
A related Github Pull-Request [GH-277] was closed
https://github.com/doctrine/dbal/pull/277