Skip to content

Pushdown subquery when applying distinct in presence of limit - #8220

Merged
smitpatel merged 1 commit into
devfrom
distinctissue
Apr 21, 2017
Merged

smitpatel merged 1 commit into
devfrom
distinctissue

Conversation

@smitpatel

Copy link
Copy Markdown
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