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

fix: remove keyword table from func is_reserved_ident #6512

Merged
merged 1 commit into from
Jul 7, 2022

Conversation

TCeason
Copy link
Collaborator

@TCeason TCeason commented Jul 6, 2022

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

Now we use the old parser to parse SQL first and then try to use planner v2.

So maybe some SQL will fail in planner v2 but success in planner v1.

In issue #6455 we find this bug. So in this pr, we fix it.

Fixes #6455

@vercel
Copy link

vercel bot commented Jul 6, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
databend ⬜️ Ignored (Inspect) Jul 6, 2022 at 11:50AM (UTC)

@mergify
Copy link
Contributor

mergify bot commented Jul 6, 2022

This pull request's title is not fulfill the requirements. @TCeason please update it 🙏.

Valid format:

fix(query): fix group by string bug
  ^         ^---------------------^
  |         |
  |         +-> Summary in present tense.
  |
  +-------> Type: feat, fix, refactor, ci, build, docs, website, chore

Valid types:

  • feat: this PR introduces a new feature to the codebase
  • fix: this PR patches a bug in codebase
  • refactor: this PR changes the code base without new features or bugfix
  • ci|build: this PR changes build/testing/ci steps
  • docs|website: this PR changes the documents or websites
  • chore: this PR only has small changes that no need to record

@xudong963 xudong963 changed the title remove keyword table from func is_reserved_ident fix: remove keyword table from func is_reserved_ident Jul 6, 2022
@xudong963
Copy link
Member

@mergify update

@mergify
Copy link
Contributor

mergify bot commented Jul 6, 2022

update

☑️ Nothing to do

  • -closed [:pushpin: update requirement]
  • #commits-behind>0 [:pushpin: update requirement]

@mergify mergify bot added the pr-bugfix this PR patches a bug in codebase label Jul 6, 2022
Copy link
Member

@xudong963 xudong963 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because in the sql standard, table is supposed to be a reserved indent.

So I'm not sure if it's appropriate to use table directly as a non-reserved indent (there could be other potential problems? But I don't think of any at the moment).

Maybe those BI tools should follow the sql standard and use table with `` instead of bare table

@BohuTANG
Copy link
Member

BohuTANG commented Jul 7, 2022

@andylokandy please take a review

@BohuTANG
Copy link
Member

BohuTANG commented Jul 7, 2022

table can be a reversed keyword, but we should make it works when it's in projections?

@TCeason
Copy link
Collaborator Author

TCeason commented Jul 7, 2022

I think not only projection but also as a expr.

@TCeason
Copy link
Collaborator Author

TCeason commented Jul 7, 2022

table can be a reversed keyword, but we should make it works when it's in projections?

Like this : table LIKE 'settings' in test sql

@BohuTANG BohuTANG merged commit 128f3d5 into databendlabs:main Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix this PR patches a bug in codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: planner v2 use keyword without `` return error
3 participants