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: render false condition for in condition if the compare values is empty #704

Merged
merged 1 commit into from
May 4, 2024

Conversation

shouwn
Copy link
Member

@shouwn shouwn commented May 4, 2024

Motivation

  • If in condition is used alone in the where clause and the compare values is empty, a malformed query is generated.

Modifications

  • If compare values is empty, it renders 0 = 1 instead of nothing.

Commit Convention Rule

Commit type Description
feat New Feature
fix Fix bug
docs Documentation only changed
ci Change CI configuration
refactor Not a bug fix or add feature, just refactoring code
test Add Test case or fix wrong test case
style Only change the code style(ex. white-space, formatting)
chore It refers to minor tasks such as library version upgrade, typo correction, etc.
  • If you want to add some more commit type please describe it on the Pull Request

Result

  • If in condition is used alone in the where clause and the compare values is empty, the malformed query is no longer generated.
  • For those who didn't use the in condition alone in the where clause, their query might not work as expected, as it would have been the same as if 1 = 1 was printed.

Closes

@shouwn shouwn requested review from pickmoment, huisam and cj848 as code owners May 4, 2024 14:16
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.01%. Comparing base (a33bf96) to head (25ce71b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #704   +/-   ##
=======================================
  Coverage   92.01%   92.01%           
=======================================
  Files         335      335           
  Lines        3417     3419    +2     
  Branches      203      203           
=======================================
+ Hits         3144     3146    +2     
  Misses        213      213           
  Partials       60       60           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@shouwn shouwn merged commit f6a8f5b into main May 4, 2024
4 checks passed
@shouwn shouwn deleted the hotfix/malformed-in-query branch May 4, 2024 14:22
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