diff options
author | Filip Navara <filip.navara@gmail.com> | 2018-10-21 00:19:21 +0200 |
---|---|---|
committer | techknowlogick <hello@techknowlogick.com> | 2018-10-20 18:19:21 -0400 |
commit | 9b2fcadeef75d9e6256c0258d39751da71847d66 (patch) | |
tree | f6b142e9edf6386a4b338b52fd39683bc79f8708 /models | |
parent | c2748ea7fe4800331e91b9e7ff62c99181fa2ed6 (diff) | |
download | gitea-9b2fcadeef75d9e6256c0258d39751da71847d66.tar.gz gitea-9b2fcadeef75d9e6256c0258d39751da71847d66.zip |
Fix SQL quoting (#5117)
`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 <navara@emclient.com>
Diffstat (limited to 'models')
-rw-r--r-- | models/user_openid.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/models/user_openid.go b/models/user_openid.go index 5255b32500..49edc1db21 100644 --- a/models/user_openid.go +++ b/models/user_openid.go @@ -93,7 +93,7 @@ func DeleteUserOpenID(openid *UserOpenID) (err error) { // ToggleUserOpenIDVisibility toggles visibility of an openid address of given user. func ToggleUserOpenIDVisibility(id int64) (err error) { - _, err = x.Exec("update user_open_id set show = not show where id = ?", id) + _, err = x.Exec("update `user_open_id` set `show` = not `show` where `id` = ?", id) return err } |