Encoding error while matching commit author with gitlab users
Created by: GromNaN
Since upgrade from 4.2 to 5.1, I get an error page (500) when I try to access to the list of commits of a project.
The author of some commits has put latin characters in its name, leading to a MySQL error of "Illegal mix of collations" between latin1 and utf8.
Started GET "/mobile/tablet_ios_lexpress/commits/master" for 193.22.107.6 at 2013-04-26 12:08:18 +0200
Processing by CommitsController#show as HTML
Parameters: {"project_id"=>"mobile/tablet_ios_lexpress", "id"=>"master"}
Rendered shared/_ref_switcher.html.haml (1.7ms)
Rendered commits/_head.html.haml (5.2ms)
Rendered commits/_commit.html.haml (2.8ms)
Rendered commits/_commits.html.haml (3.4ms)
Rendered commits/show.html.haml within layouts/project_resource (9.3ms)
Completed 500 Internal Server Error in 48ms
ActionView::Template::Error (Mysql2::Error: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'like': SELECT `users`.* FROM `users` WHERE (name like '*** BoueÌ' or email like '***.boue@***.com') LIMIT 1):
4: %strong= link_to "Browse Code »", project_tree_path(@project, commit), class: "right"
5: %p
6: = link_to commit.short_id(8), project_commit_path(@project, commit), class: "commit_short_id"
7: = commit_author_link(commit, avatar: true, size: 24)
8:
9: = link_to_gfm truncate(commit.title, length: 70), project_commit_path(@project, commit.id), class: "row_title"
10:
config/initializers/connection_fix.rb:22:in `execute'
app/helpers/commits_helper.rb:168:in `commit_person_link'
app/helpers/commits_helper.rb:10:in `commit_author_link'
app/views/commits/_commit.html.haml:7:in `_app_views_commits__commit_html_haml___4474771590812468284_70066457230500'
app/views/commits/_commits.html.haml:9:in `block in _app_views_commits__commits_html_haml__732980033007641843_70066457054520'
app/views/commits/_commits.html.haml:1:in `each'
app/views/commits/_commits.html.haml:1:in `_app_views_commits__commits_html_haml__732980033007641843_70066457054520'
app/views/commits/show.html.haml:8:in `_app_views_commits_show_html_haml__2548615895601287645_70066452626340'
app/controllers/commits_controller.rb:17:in `show'