DBAL-454: [GH-277] Remove duplicate SQL parts in query generation #1652

Closed
doctrinebot opened this Issue Mar 2, 2013 · 3 comments

2 participants

@doctrinebot

Jira issue originally created by user @beberlei:

This issue is created automatically through a Github pull request on behalf of gigablah:

Url: #277

Message:

Presently, it's possible to do this using QueryBuilder:

$qb->select('u.*')
   ->from('users', 'u')
   ->addOrderBy('u.name', 'ASC')
   ->addOrderBy('u.name', 'ASC'); // duplicate

Which produces:

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.

@doctrinebot

Comment created by @beberlei:

A related Github Pull-Request [GH-277] was closed
#277

@doctrinebot

Issue was closed with resolution "Invalid"

@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-277] was closed:
doctrine/common#277

@doctrinebot doctrinebot added the Bug label Dec 6, 2015
@Ocramius Ocramius was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment