-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Simplify the code to get issue count #19380
Conversation
Wait, does that actually work? |
This PR is not ideal and the underlying problem is still not resolved.
|
b78428b
to
16103bb
Compare
As I said, this PR is not a bug fix. I haven't found the problem of the previous code. |
Does XORM report an error if |
If there is a bug there, it's not related XORM or Gitea, it's an upstream problem. Mysql-driver or mysql server. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Then should Gitea hide such bug, or report such problem to end users (at least in logs)? |
I would like we do the later. |
Now we have a good chance to find the root case about the bug that If this PR gets merged, no way and nobody would continue the debug work. I prefer to find the root case of the bug first, then take this refactoring. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue (#19368) itself is a MariaDB bug with prepared statements.
To handle all similar problems gracefully in future, some improvements from XORM side:
- Make XORM's
Count
return an error if the result is 0 row. - Make XORM report warnings for SQLs with more than xxxx parameters (eg: 16384), then users/developers can know there is something needed to be refactored, they have enough time to optimize the query before the hard limit comes.
I do not think it's worth to be backported, it's not a bug fix. |
* giteaofficial/main: Simplify the code to get issue count (go-gitea#19380) use IsLoopback (go-gitea#19477) [skip ci] Updated translations via Crowdin Add RSS Feed buttons to Repo, User and Org pages (go-gitea#19370) [doctor] authorized-keys: fix displayed check name (go-gitea#19464) [skip ci] Updated translations via Crowdin Use horizontal tabs for repo header on mobile (go-gitea#19468)
* Simple the code to get issue count * Improve codes
Since it's a count SQL, we just need to use
Count
.