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

[385] fix binary data encoding issue with tests #387

Conversation

cianmce
Copy link
Contributor

@cianmce cianmce commented Feb 23, 2022

Following on from issue: #385

Possibly also fixes #364

Issue

We have been using Blazer with some tables that have binary UUID columns.
When returning data that has binary data and plain text data it raises an error.

e.g. running the following SQL with a MySQL data source

select unhex("F6"), 123

raises

Encoding::UndefinedConversionError - "\xF6" from ASCII-8BIT to UTF-8:

This only happens if

  1. the binary column is the first column returned
  2. there's no non-binary columns after the binary columns

e.g. these all work

select unhex("F6"); /* this works */
select unhex("F6"), unhex("F6"); /* this works */
select 123, unhex("F6"); /* this works */
select 123, unhex("F6"), 123; /* this works */

@cianmce cianmce changed the title 385 fix binary data encoding issue with tests [385] fix binary data encoding issue with tests Feb 23, 2022
@ankane ankane closed this in 011c2c8 Apr 21, 2022
@ankane
Copy link
Owner

ankane commented Apr 21, 2022

Hey @cianmce, thanks for reporting and the PR! It looks like it was due to the charting logic. Should be fixed in the commit above, but let me know if there are other queries that don't work.

khasinski pushed a commit to khasinski/blazer that referenced this pull request Sep 24, 2023
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 this pull request may close these issues.

Set character encoding
2 participants