New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed SQLServer ORDER BY problem in paginator CountOutputWalker #572

Closed
wants to merge 3 commits into
base: master
from

Conversation

Projects
None yet
6 participants
@norzechowicz
Contributor

norzechowicz commented Feb 7, 2013

Code explains everything :)

@doctrinebot

This comment has been minimized.

Show comment
Hide comment
@doctrinebot

doctrinebot Feb 7, 2013

Hello,

thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:

http://doctrine-project.org/jira/browse/DDC-2282

doctrinebot commented Feb 7, 2013

Hello,

thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:

http://doctrine-project.org/jira/browse/DDC-2282

@Ocramius

This comment has been minimized.

Show comment
Hide comment
@Ocramius

Ocramius Feb 7, 2013

Member

@norzechowicz such kind of fix needs a test that was failing before the patch was applied.

Member

Ocramius commented Feb 7, 2013

@norzechowicz such kind of fix needs a test that was failing before the patch was applied.

@mvrhov

This comment has been minimized.

Show comment
Hide comment
@mvrhov

mvrhov Feb 7, 2013

Contributor

Well the orderBy on count is not needed on any database, but I had crashes on 5.4 if set to null.

Contributor

mvrhov commented Feb 7, 2013

Well the orderBy on count is not needed on any database, but I had crashes on 5.4 if set to null.

@norzechowicz

This comment has been minimized.

Show comment
Hide comment
@norzechowicz

norzechowicz Feb 8, 2013

Contributor

@mvrhov there is a comment above walkSelectStatement() method. https://github.com/norzechowicz/doctrine2/blob/d04dc7421430a493cdb35035b36c2b777a4f2ad2/lib/Doctrine/ORM/Tools/Pagination/CountOutputWalker.php#L71 I think this is the reasony why ORDER BY is not removed from count query.

@Ocramius Any suggestions how should I write this test? This is sql server engine problem and without connection to database I can't prove that the current query is failing.

Below comment comes from database engine.

The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP or FOR XML is also specified

Btw. This is the tests result with SQL Server 2008 R2 database:

FAILURES! Tests: 1878, Assertions: 6555, Failures: 2, Errors: 20, Skipped: 33.

Contributor

norzechowicz commented Feb 8, 2013

@mvrhov there is a comment above walkSelectStatement() method. https://github.com/norzechowicz/doctrine2/blob/d04dc7421430a493cdb35035b36c2b777a4f2ad2/lib/Doctrine/ORM/Tools/Pagination/CountOutputWalker.php#L71 I think this is the reasony why ORDER BY is not removed from count query.

@Ocramius Any suggestions how should I write this test? This is sql server engine problem and without connection to database I can't prove that the current query is failing.

Below comment comes from database engine.

The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP or FOR XML is also specified

Btw. This is the tests result with SQL Server 2008 R2 database:

FAILURES! Tests: 1878, Assertions: 6555, Failures: 2, Errors: 20, Skipped: 33.

@Ocramius

This comment has been minimized.

Show comment
Hide comment
@Ocramius

Ocramius Feb 8, 2013

Member

@norzechowicz if you configured the test suite to use a db on your SQL Server, then you're already good to go (check phpunit.xml.dist)

Member

Ocramius commented Feb 8, 2013

@norzechowicz if you configured the test suite to use a db on your SQL Server, then you're already good to go (check phpunit.xml.dist)

@norzechowicz

This comment has been minimized.

Show comment
Hide comment
@norzechowicz

norzechowicz Feb 8, 2013

Contributor

@Ocramius At the moment pagination tests operate on ConnectionMock, should this be changed?

Contributor

norzechowicz commented Feb 8, 2013

@Ocramius At the moment pagination tests operate on ConnectionMock, should this be changed?

@Ocramius

This comment has been minimized.

Show comment
Hide comment
@Ocramius

Ocramius Feb 8, 2013

Member

@norzechowicz you can do assertions on the SQL thrown at the connection mock

Member

Ocramius commented Feb 8, 2013

@norzechowicz you can do assertions on the SQL thrown at the connection mock

@norzechowicz

This comment has been minimized.

Show comment
Hide comment
@norzechowicz

norzechowicz Feb 8, 2013

Contributor

@Ocramius sorry but I dont understand how assertion on connection mock can prove that something is failing on a specific db engine :/ I'm afraid I will not be able to write this test.

Contributor

norzechowicz commented Feb 8, 2013

@Ocramius sorry but I dont understand how assertion on connection mock can prove that something is failing on a specific db engine :/ I'm afraid I will not be able to write this test.

@mrsushiface

This comment has been minimized.

Show comment
Hide comment
@mrsushiface

mrsushiface Feb 22, 2013

Any movement on this? SQLServer user here encountering issue, confirmed code fixed my issue.

mrsushiface commented Feb 22, 2013

Any movement on this? SQLServer user here encountering issue, confirmed code fixed my issue.

@norzechowicz

This comment has been minimized.

Show comment
Hide comment
@norzechowicz

norzechowicz Feb 26, 2013

Contributor

@Ocramius Test added, can you check it now?

Contributor

norzechowicz commented Feb 26, 2013

@Ocramius Test added, can you check it now?

@norzechowicz

This comment has been minimized.

Show comment
Hide comment
@norzechowicz

norzechowicz Feb 26, 2013

Contributor

@Ocramius done :)

Contributor

norzechowicz commented Feb 26, 2013

@Ocramius done :)

@norzechowicz

This comment has been minimized.

Show comment
Hide comment
@norzechowicz

norzechowicz Feb 27, 2013

Contributor

@beberlei is there any chance to merge this into 2.3 branch?

Contributor

norzechowicz commented Feb 27, 2013

@beberlei is there any chance to merge this into 2.3 branch?

@norzechowicz

This comment has been minimized.

Show comment
Hide comment
@norzechowicz

norzechowicz Mar 12, 2013

Contributor

@doctrine I know u guys are very busy but this is rly big issue for SQL Server 2008 users.

Contributor

norzechowicz commented Mar 12, 2013

@doctrine I know u guys are very busy but this is rly big issue for SQL Server 2008 users.

beberlei added a commit that referenced this pull request Mar 12, 2013

beberlei added a commit that referenced this pull request Mar 12, 2013

@beberlei

This comment has been minimized.

Show comment
Hide comment
@beberlei

beberlei Mar 12, 2013

Member

Adjusted to affect SQL Server only, squashed, Merged into master and into 2.3

Member

beberlei commented Mar 12, 2013

Adjusted to affect SQL Server only, squashed, Merged into master and into 2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment