Skip to content

Commit 7238bb3

Browse files
filipnavaratechknowlogick
authored andcommitted
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 <[email protected]>
1 parent 49d666f commit 7238bb3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/user_openid.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func DeleteUserOpenID(openid *UserOpenID) (err error) {
9393

9494
// ToggleUserOpenIDVisibility toggles visibility of an openid address of given user.
9595
func ToggleUserOpenIDVisibility(id int64) (err error) {
96-
_, err = x.Exec("update user_open_id set show = not show where id = ?", id)
96+
_, err = x.Exec("update `user_open_id` set `show` = not `show` where `id` = ?", id)
9797
return err
9898
}
9999

0 commit comments

Comments
 (0)