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(clause): clause equal empty array #6502

Closed
wants to merge 1 commit into from

Conversation

whcao
Copy link
Contributor

@whcao whcao commented Aug 4, 2023

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

when the value of clause.Eq is an empty array, the SQL should be IN (NULL)

User Case Description

CASE: clause.Eq{Column: column, Value: []string{}}
ERROR: syntax error at or near ")" (SQLSTATE 42601)

@jinzhu
Copy link
Member

jinzhu commented Aug 4, 2023

Hi @whcao

Thank you for your PR, NOT IN (NULL) will match nothing, so we want to raise this case as an error to avoid misunderstanding.

@jinzhu jinzhu closed this Aug 4, 2023
@jinzhu
Copy link
Member

jinzhu commented Aug 4, 2023

Maybe we can only change the Eq expression, which looks good to me and it don't cause the misunderstanding.

Would you mind to create another pull request?

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