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

when query with SubQuery logger output sql wrong #3437

Closed
zzjin opened this issue Sep 9, 2020 · 2 comments
Closed

when query with SubQuery logger output sql wrong #3437

zzjin opened this issue Sep 9, 2020 · 2 comments
Assignees
Labels
type:with reproduction steps with reproduction steps

Comments

@zzjin
Copy link

zzjin commented Sep 9, 2020

GORM Playground Link

https://github.com/go-gorm/playground/pull/126/checks

Description

the first output log is wrong param:
want: SELECT idFROMcompanies WHERE id > 1 AND name <> "asdf"
actual: SELECT idFROMcompanies WHERE id > 18 AND name <> 1

@github-actions github-actions bot added the type:with reproduction steps with reproduction steps label Sep 9, 2020
@jinzhu
Copy link
Member

jinzhu commented Sep 9, 2020

The final SQL looks correct, but the above one should not display in log

SELECT * FROM users WHERE age>18 AND company_id > SELECT id FROM companies WHERE id > 1 AND name <> "asdf" AND users.deleted_at IS NULL

@jinzhu jinzhu closed this as completed in f6117b7 Sep 9, 2020
@jinzhu
Copy link
Member

jinzhu commented Sep 9, 2020

Fixed the output, thank you for your report.

cgxxv pushed a commit to cgxxv/gorm that referenced this issue Mar 25, 2022
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