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

planner: open the new only_full_group_by check #7

Merged
merged 28 commits into from
Mar 14, 2022

Conversation

winoros
Copy link
Owner

@winoros winoros commented Mar 2, 2022

What problem does this PR solve?

This pr use the functional dependency to check the only_full_group_by constraint.

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

  • Has exported function/method change
  • Has exported variable/fields change
  • Has interface methods change
  • Has persistent data change

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation
  • Need to update the tidb-ansible repository
  • Need to be included in the release note

Signed-off-by: ailinkid <314806019@qq.com>
Signed-off-by: ailinkid <314806019@qq.com>
Signed-off-by: ailinkid <314806019@qq.com>
Signed-off-by: ailinkid <314806019@qq.com>
@AilinKid
Copy link
Collaborator

AilinKid commented Mar 6, 2022

create table ttest (v1 int, v2 int);
insert into ttest values(1, 2), (4,6), (1, 7);

mysql> select distinct v1 from ttest where v1=2 order by v2;
ERROR 3065 (HY000): Expression #1 of ORDER BY clause is not in SELECT list, references column 'test.ttest.v2' which is not in SELECT list; this is incompatible with DISTINCT
mysql> select distinct 1 from ttest order by v1;
ERROR 3065 (HY000): Expression #1 of ORDER BY clause is not in SELECT list, references column 'test.ttest.v1' which is not in SELECT list; this is incompatible with DISTINCT

the same is as crdb, postgres, mysql, even constant here won't be passed either.

@winoros winoros changed the title planner: refactor the interface of the LogicalPlan planner: open the new only_full_group_by check Mar 7, 2022
Signed-off-by: ailinkid <314806019@qq.com>
Signed-off-by: ailinkid <314806019@qq.com>
Signed-off-by: ailinkid <314806019@qq.com>
winoros and others added 3 commits March 13, 2022 21:20
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.

2 participants