From 7238bb329a5ee3daf03fb5ba9049655e69747d3e Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Mon, 22 Oct 2018 20:46:47 +0200 Subject: [PATCH] Fix SQL quoting (#5137) `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 --- models/user_openid.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/user_openid.go b/models/user_openid.go index 5255b3250..49edc1db2 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 }