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 issue #2782 that orm builder generate incorrect sql in some case #2787

Merged
merged 3 commits into from
Jul 25, 2023

Conversation

Agzer0
Copy link
Contributor

@Agzer0 Agzer0 commented Jul 20, 2023

fix issues #2782 : When ORM is constructing multiple SQL conditions, the OmitEmpty option is used. If the first condition is empty conditions and the second condition is the compound condition. At this time, when there is still a third condition, the generated SQL is wrong.

@gqcn
Copy link
Member

gqcn commented Jul 20, 2023

@Agzer0 Thanks for your contribution, but please commit associated unit testing case for this update. Please add the unit testing case here: https:/gogf/gf/blob/master/contrib/drivers/mysql/mysql_issue_test.go . There're reference cases already for you.

@gqcn gqcn added the missing unit testing cases Missing unit testing cases for this PR. label Jul 20, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jul 20, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (4ad508c) 79.15% compared to head (eff41ee) 79.15%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2787   +/-   ##
=======================================
  Coverage   79.15%   79.15%           
=======================================
  Files         632      632           
  Lines       52174    52174           
=======================================
+ Hits        41298    41300    +2     
+ Misses       8830     8828    -2     
  Partials     2046     2046           
Flag Coverage Δ
go-1.15-386 79.17% <100.00%> (-0.01%) ⬇️
go-1.15-amd64 79.16% <100.00%> (-0.04%) ⬇️
go-1.16-386 79.17% <100.00%> (ø)
go-1.16-amd64 79.17% <100.00%> (-0.01%) ⬇️
go-1.17-386 79.17% <100.00%> (+<0.01%) ⬆️
go-1.17-amd64 79.16% <100.00%> (+<0.01%) ⬆️
go-1.18-386 78.78% <100.00%> (-0.01%) ⬇️
go-1.18-amd64 78.78% <100.00%> (?)
go-1.19-386 79.16% <100.00%> (?)
go-1.19-amd64 79.16% <100.00%> (ø)
go-1.20-386 79.14% <100.00%> (?)
go-1.20-amd64 79.13% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
database/gdb/gdb_model_builder.go 97.29% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Agzer0
Copy link
Contributor Author

Agzer0 commented Jul 20, 2023

okay, i`ve added testing case

@houseme houseme requested a review from gqcn July 21, 2023 03:00
@gqcn gqcn merged commit 83fa359 into gogf:master Jul 25, 2023
18 checks passed
@gqcn gqcn changed the title fix: orm generate sql wrong, issues #2782 fix issue #2782 that orm builder generate incorrect sql in some case Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
missing unit testing cases Missing unit testing cases for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants