Skip to content
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

Pushdown subquery when applying distinct in presence of limit #8220

Merged
merged 1 commit into from
Apr 21, 2017

Conversation

smitpatel
Copy link
Contributor

Distinct clears ordering and in the presence of limit it can create incorrect results.
Add counter in RowNumberPagingExpressionVisitor because for a multi level nested subquery, inner subquery can provide column with RowNumber while we are adding it on outer level which causes name clash for a subquery
Counter make sure to unique-fy them for given select expression.
Moved the visitor to constructor

Resolves #7525

Distinct clears ordering and in the presence of limit it can create incorrect results.
Add counter in RowNumberPagingExpressionVisitor because for a multi level nested subquery, inner subquery can provide column with RowNumber while we are adding it on outer level which causes name clash for a subquery
Counter make sure to unique-fy them for given select expression.
Moved the visitor to constructor
@smitpatel smitpatel merged commit 09f3631 into dev Apr 21, 2017
@smitpatel smitpatel deleted the distinctissue branch April 21, 2017 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants