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

Fix SQL quoting #5117

Merged
merged 2 commits into from
Oct 20, 2018
Merged

Fix SQL quoting #5117

merged 2 commits into from
Oct 20, 2018

Conversation

filipnavara
Copy link
Contributor

@filipnavara filipnavara commented Oct 19, 2018

show is keyword in MySQL and has to be quoted to reference a column name. Use grave accents (ASCII code 96) for quoting to match rest of the source code. It's non-standard SQL, but it's supported by SQLite and MySQL.

Fixes #5106

`show` is keyword in MySQL and has to be quoted to reference a column name. Use grave accents (ASCII code 96) for quoting to match rest of the source code. It's non-standard SQL, but it's supported by SQLite and MySQL.

Signed-off-by: Filip Navara <[email protected]>
@codecov-io
Copy link

codecov-io commented Oct 19, 2018

Codecov Report

Merging #5117 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #5117   +/-   ##
======================================
  Coverage    37.4%   37.4%           
======================================
  Files         308     308           
  Lines       45612   45612           
======================================
  Hits        17060   17060           
  Misses      26095   26095           
  Partials     2457    2457
Impacted Files Coverage Δ
models/user_openid.go 28.98% <100%> (ø) ⬆️

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 c2748ea...e388d5a. Read the comment docs.

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 19, 2018
@er1z
Copy link

er1z commented Oct 19, 2018

But PostgreSQL nope, AFAIR.

@filipnavara
Copy link
Contributor Author

filipnavara commented Oct 19, 2018

@er1z I assume it is handled somehow by the libraries because the rest of Gitea code base uses it too.

Update: QuoteFilter in go-xorm (replace ` to database's own quote character)

@bkcsoft bkcsoft added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Oct 20, 2018
@lafriks lafriks added this to the 1.6.0 milestone Oct 20, 2018
@bkcsoft bkcsoft 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 20, 2018
@lafriks lafriks changed the title WIP: Fix SQL quoting Fix SQL quoting Oct 20, 2018
@techknowlogick techknowlogick merged commit 9b2fcad into go-gitea:master Oct 20, 2018
@techknowlogick
Copy link
Member

@filipnavara thanks for PR 😄 Please send backport of PR to release/v1.6 branch

@filipnavara filipnavara mentioned this pull request Oct 22, 2018
@lafriks lafriks added the backport/done All backports for this PR have been created label Nov 8, 2018
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
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.

HTTP Error 500 when publishing openid url
7 participants