[MDEV-10867] PREPARE..EXECUTE is not consistent about non-ASCII characters Created: 2016-09-22 Updated: 2017-04-09 Resolved: 2016-10-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Character Sets, Prepared Statements |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.2 |
| Fix Version/s: | 10.2.3, 10.3.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I start a 8-bit console. Now I run this command in shell:
and check that the client correctly detected the session character set as latin1:
Now I run:
It correctly returns 0xE4, which is a latin1 code for "U+00E4 SMALL LETTER A WITH DIAERESIS". Now I use a prepared statement with a user variable as a source:
It also returns the same latin1 code. So far so good. Now I use a prepared statement with a string literal as a source:
It returns a different result. C3A4 is a utf8 code for "U+00E4 SMALL LETTER A WITH DIAERESIS". Conversion from latin1 to utf8 happened. |
| Comments |
| Comment by Alexander Barkov [ 2016-09-23 ] | |||||||||||||||||||||||
|
A similar problem is repeatable using a non-BMP character.
Then copy and paste the character instead of all 'X' below. 1. Convensional execution works fine:
2. Prepared execution using a user variable as a source also works fine:
3. Prepared execution using a string literal as a source return a wrong result:
|