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

Query: Generate OrderBy (Select 1) #15713

Open
smitpatel opened this issue May 14, 2019 · 3 comments · Fixed by #16380
Open

Query: Generate OrderBy (Select 1) #15713

smitpatel opened this issue May 14, 2019 · 3 comments · Fixed by #16380

Comments

@smitpatel
Copy link
Contributor

No description provided.

@roji
Copy link
Member

roji commented Jun 29, 2019

@smitpatel going to give this a try

@roji roji assigned roji and unassigned smitpatel Jun 29, 2019
@roji roji removed the poachable label Jun 29, 2019
roji added a commit that referenced this issue Jul 1, 2019
Our InExpressionValuesExpanding visitor can turn an an IN expression
to a constant (i.e. when the values list is empty), which is
unsupported in orderings in SqlServer. Detect this and turn these
expressions to a simple constant expression detectable by the
SQL generator, which will generate (SELECT 1).

Fixes #15713
roji added a commit that referenced this issue Jul 1, 2019
Our InExpressionValuesExpanding visitor can turn an an IN expression
to a constant (i.e. when the values list is empty), which is
unsupported in orderings in SqlServer. Detect this and turn these
expressions to a simple constant expression detectable by the
SQL generator, which will generate (SELECT 1).

Fixes #15713
roji added a commit that referenced this issue Jul 2, 2019
Our InExpressionValuesExpanding visitor can turn an an IN expression
to a constant (i.e. when the values list is empty), which is
unsupported in orderings in SqlServer. Detect this and turn these
expressions to a simple constant expression detectable by the
SQL generator, which will generate (SELECT 1).

Fixes #15713
@ajcvickers ajcvickers modified the milestones: 3.0.0, 3.0.0-preview7 Jul 2, 2019
roji added a commit that referenced this issue Jul 2, 2019
Our InExpressionValuesExpanding visitor can turn an an IN expression
to a constant (i.e. when the values list is empty), which is
unsupported in orderings in SqlServer. Detect this and turn these
expressions to a simple constant expression detectable by the
SQL generator, which will generate (SELECT 1).

Fixes #15713
roji added a commit that referenced this issue Jul 2, 2019
Our InExpressionValuesExpanding visitor can turn an an IN expression
to a constant (i.e. when the values list is empty), which is
unsupported in orderings in SqlServer. Detect this and turn these
expressions to a simple constant expression detectable by the
SQL generator, which will generate (SELECT 1).

Fixes #15713
@smitpatel smitpatel reopened this Jul 2, 2019
@smitpatel
Copy link
Contributor Author

Had to revert commit because we need better logic to identify columns to remove.
Presence of column reference is not enough. Count(*) is valid term.

roji added a commit that referenced this issue Jul 3, 2019
Our InExpressionValuesExpanding visitor can turn an an IN expression
to a constant (i.e. when the values list is empty), which is
unsupported in orderings in SqlServer. Detect this and turn these
expressions to a simple constant expression detectable by the
SQL generator, which will generate (SELECT 1).

Fixes #15713
@roji
Copy link
Member

roji commented Aug 7, 2019

@smitpatel if you think it will save you time, you can define the logic here and I can implement. IMHO the presence of column references or COUNT(*) specifically (which implicitly refers to columns) should be enough for more cases but I may be missing other cases.

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

Successfully merging a pull request may close this issue.

3 participants