[MDEV-11928] Session charset applied to COLUMN_GET() first arg in 10.1 Created: 2017-01-27 Updated: 2017-03-07 Resolved: 2017-03-07 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Dynamic Columns |
| Affects Version/s: | 10.1.20 |
| Fix Version/s: | 10.1.21 |
| Type: | Bug | Priority: | Major |
| Reporter: | Tom | Assignee: | Oleksandr Byelkin |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Sprint: | 10.1.22 |
| Description |
|
I added this as a comment to The gist of it
returns 246 in 10.0 and -64 in 10.1. I'm guessing this was added to the docs as resolution for
but the wording doesn't exactly apply. I am not trying to get a nested column as a string. I have a previously functioning ORM that generates Maria-specific SQL, which wrote an SQL expression involving a nested dynamic column's value. The integer value of the expression is a function of server version. I don't understand how the server works but it appears the server was changed so that in
Maria 10.1 modifies the value of the 1st param of the outer column_get() by converting from the client charset (utf8) to binary? It's not clear to me:
1. Before upgradeIn good-old 10.0, char was understood when it was inside a
2. After upgradeNow we need to do more work in our ORM
|
| Comments |
| Comment by Elena Stepanova [ 2017-02-01 ] | ||||||||||
|
Thanks for the report. | ||||||||||
| Comment by Oleksandr Byelkin [ 2017-03-03 ] | ||||||||||
|
It looks like signed/unsigned problem. Actually converting number to character and back looks for me dangerous in any case. | ||||||||||
| Comment by Oleksandr Byelkin [ 2017-03-03 ] | ||||||||||
|
So problem is probably in setup which changed: The problem in your setup that it can't make utf-8 character from number. So I need to know what configuration used to reproduce the problem. or you will see yourself what to change to fix if you really need such dangerous tricks. | ||||||||||
| Comment by Oleksandr Byelkin [ 2017-03-07 ] | ||||||||||
|
It looks like a bug in 10.0, it do not react on charset properly. Correct assignment should be with charset mentioning: but 10.0 ignore them and even following processed as latin1: | ||||||||||
| Comment by Tom [ 2017-03-07 ] | ||||||||||
|
Please confirm my understanding. We can avoid the dangers you mention if we access nested dynamic column values using AS binary in all but the outermost COLUMN_GET() Thus, for example
Where whatever is some type suitable to the app. I made this assumption in the fix to the ORM | ||||||||||
| Comment by Oleksandr Byelkin [ 2017-03-07 ] | ||||||||||
|
Thanks Alexandr Barkov for finding what changed in 10.1, it was fix of To make make conversion number->symbol stable and unreliable on external changes it is better to mention charset explicitly or in any other way (SET NAMES for examples) to set such charset where number you want has sens as a character, otherwise (like with number 123 and utf8) it will be replaced with '?' (what we have here). | ||||||||||
| Comment by Oleksandr Byelkin [ 2017-03-07 ] | ||||||||||
|
Yes, binary or latin1 or something where all numbers correspond to some characters (actually yes, binary probably is better) | ||||||||||
| Comment by Oleksandr Byelkin [ 2017-03-07 ] | ||||||||||
|
So I close the issue as it is actually consequence of bug fixed. If you have more questions ask and reopen it please. |