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

Quote the table name in CountOrphanedObjects #17487

Merged

Conversation

zeripath
Copy link
Contributor

CountOrphanedObjects needs to quote the table it is joining with as this table may
be user.

Fix #17485

Signed-off-by: Andrew Thornton art27@cantab.net

CountOrphanedObjects needs to quote the table it is joining with as this table may
be `user`.

Fix go-gitea#17485

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added this to the 1.16.0 milestone Oct 29, 2021
zeripath added a commit to zeripath/gitea that referenced this pull request Oct 29, 2021
Backport go-gitea#17487

CountOrphanedObjects needs to quote the table it is joining with as this table may
be `user`.

Fix go-gitea#17485

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added the backport/done All backports for this PR have been created label Oct 29, 2021
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Oct 29, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #17487 (bf25986) into main (e6e3b21) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #17487   +/-   ##
=======================================
  Coverage   45.48%   45.49%           
=======================================
  Files         791      791           
  Lines       88702    88702           
=======================================
+ Hits        40350    40355    +5     
+ Misses      41841    41830   -11     
- Partials     6511     6517    +6     
Impacted Files Coverage Δ
models/consistency.go 45.66% <100.00%> (ø)
modules/notification/mail/mail.go 35.29% <0.00%> (-2.95%) ⬇️
modules/process/manager.go 72.83% <0.00%> (-2.47%) ⬇️
modules/charset/charset.go 73.73% <0.00%> (-2.03%) ⬇️
modules/notification/ui/ui.go 60.86% <0.00%> (-1.45%) ⬇️
models/notification.go 65.28% <0.00%> (-0.88%) ⬇️
models/repo_list.go 78.43% <0.00%> (-0.79%) ⬇️
modules/queue/queue_bytefifo.go 59.28% <0.00%> (-0.60%) ⬇️
services/pull/pull.go 41.78% <0.00%> (-0.41%) ⬇️
models/issue_comment.go 51.89% <0.00%> (+0.29%) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e6e3b21...bf25986. Read the comment docs.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Oct 30, 2021
@zeripath
Copy link
Contributor Author

make lgtm work

@zeripath zeripath merged commit 76a3190 into go-gitea:main Oct 30, 2021
@zeripath zeripath deleted the fix-17485-add-missing-quotes-in-dbconsistency branch October 30, 2021 09:17
6543 pushed a commit that referenced this pull request Oct 30, 2021
Backport #17487

CountOrphanedObjects needs to quote the table it is joining with as this table may
be `user`.

Fix #17485

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit to zeripath/gitea that referenced this pull request Dec 22, 2021
Although go-gitea#17487 ensured that the table was quoted in the join it missed that the
query part of the check also needed to be quoted.

Fix go-gitea#17485

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit to zeripath/gitea that referenced this pull request Dec 22, 2021
)

Backport go-gitea#18072

Although go-gitea#17487 ensured that the table was quoted in the join it missed that the
query part of the check also needed to be quoted.

Fix go-gitea#17485

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit that referenced this pull request Dec 22, 2021
…8073)

Backport #18072

Although #17487 ensured that the table was quoted in the join it missed that the
query part of the check also needed to be quoted.

Fix #17485

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit that referenced this pull request Dec 22, 2021
Although #17487 ensured that the table was quoted in the join it missed that the
query part of the check also needed to be quoted.

Fix #17485

Signed-off-by: Andrew Thornton <art27@cantab.net>
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
CountOrphanedObjects needs to quote the table it is joining with as this table may
be `user`.

Fix go-gitea#17485

Signed-off-by: Andrew Thornton <art27@cantab.net>
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
)

Although go-gitea#17487 ensured that the table was quoted in the join it missed that the
query part of the check also needed to be quoted.

Fix go-gitea#17485

Signed-off-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: pq: syntax error at or near "." whilst counting Collaborations without existing user
5 participants