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

"Illegal mix of collations" error when using CSV Static Endpoint for queries with emojis #1046

Closed
shuttie opened this issue Jul 30, 2024 · 2 comments · Fixed by #1223
Closed

Comments

@shuttie
Copy link

shuttie commented Jul 30, 2024

Describe the bug
When I create a CSV Static File endpoint with a CSV file having queries with UTF surrogate pairs (e.g. emojis), import fails:

[75432bc3-6079-4423-8949-020bdc6d7abb] Completed 500 Internal Server Error in 15ms (ActiveRecord: 7.5ms | Allocations: 2639)
[75432bc3-6079-4423-8949-020bdc6d7abb]   
[75432bc3-6079-4423-8949-020bdc6d7abb] ActiveRecord::StatementInvalid (Mysql2::Error: Illegal mix of collations (utf8mb3_general_ci,IMPLICIT) and (utf8mb4_bin,COERCIBLE) for operation '='):

A sample file reproducing the issue: kfc.csv
Where the query is kfc 🍟➕🍔➕🍗 - yes I also wonder who searches like that, but here we are.

To Reproduce
Steps to reproduce the behavior on v7.17.1:

  1. Go to Relevance Cases > Create case
  2. Click on 'CSV Static Endpoint' and upload sample file (or any other with surrogate pairs)
  3. Click 'import',
  4. UI hangs, and in console there's Mysql2::Error: Illegal mix of collations error.

Expected behavior
Expected the UI and import not to break on such weird queries.

@epugh
Copy link
Member

epugh commented Feb 11, 2025

Just tested this, and yeah:

ActiveRecord::StatementInvalid (Mysql2::Error: Illegal mix of collations (utf8mb3_general_ci,IMPLICIT) and (utf8mb4_bin,COERCIBLE) for operation '=')
Caused by: Mysql2::Error (Illegal mix of collations (utf8mb3_general_ci,IMPLICIT) and (utf8mb4_bin,COERCIBLE) for operation '=')

Information for: ActiveRecord::StatementInvalid (Mysql2::Error: Illegal mix of collations (utf8mb3_general_ci,IMPLICIT) and (utf8mb4_bin,COERCIBLE) for operation '='):

Sorry it's taken so long to get to this, I somehow missed it after having just a quick glance. Working on this now for upcoming Quepid8 release.

@shuttie
Copy link
Author

shuttie commented Feb 14, 2025

Thanks @epugh - as a millennial myself, never thought that people might use emojis as a search query 🍔 . but here we are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants