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

gdb: issue The SQL is wrong when using "WhereNotIn", if an empty parameter is passed #3619

Open
developer-r2tech opened this issue May 30, 2024 · 1 comment
Labels
bug It is confirmed a bug, but don't worry, we'll handle it.

Comments

@developer-r2tech
Copy link

Go version

go version go1.21.9 linux/amd64

GoFrame version

2.7.1

Can this bug be reproduced with the latest release?

Option Yes

What did you do?

var ids []int
dao.User.Ctx(ctx).WhereNotIn("id", ids).Count()

What did you see happen?

SELECT COUNT(1) FROM user WHERE 0=1

What did you expect to see?

SELECT COUNT(1) FROM user WHERE 1=1

@developer-r2tech developer-r2tech added the bug It is confirmed a bug, but don't worry, we'll handle it. label May 30, 2024
@developer-r2tech developer-r2tech changed the title orm: issue The SQL is wrong when using "WhereNotIn", if an empty parameter is passed gdb: issue The SQL is wrong when using "WhereNotIn", if an empty parameter is passed May 30, 2024
@niluan304
Copy link
Contributor

maybe better?

SELECT COUNT(1) FROM `user` WHERE NOT 0=1;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It is confirmed a bug, but don't worry, we'll handle it.
Projects
None yet
Development

No branches or pull requests

2 participants