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

Where builder not wrapping parentheses around multiline string clauses #7351

Open
sam-wbcx opened this issue Jan 22, 2025 · 1 comment
Open
Assignees
Labels
type:with reproduction steps with reproduction steps

Comments

@sam-wbcx
Copy link

sam-wbcx commented Jan 22, 2025

GORM Playground Link

go-gorm/playground#784

Description

At some point in the last few releases, I think that the Where builder has lost the ability to wrap parentheses around some multiline clauses, which causes some issues when those clauses contain an OR. We have several instances of these in our codebase that ran fine under Gorm v1.21.15, but we ran into some test failures when attempting to upgrade to the latest version.

@github-actions github-actions bot added the type:with reproduction steps with reproduction steps label Jan 22, 2025
@sam-wbcx
Copy link
Author

Glancing over the code, I think this may be due to the lack of a space before the "OR" (I think it can be some other whitespace characters, like newline or tab) https://github.com/go-gorm/gorm/blob/master/clause/where.go#L9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:with reproduction steps with reproduction steps
Projects
None yet
Development

No branches or pull requests

2 participants