[MDEV-24584] Selecting INT column with COLLATE utf8mb4_general_ci throws an error Created: 2021-01-13 Updated: 2024-01-26 Resolved: 2021-11-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Character Sets |
| Affects Version/s: | 5.5, 10.1, 10.5.4, 10.5.6, 10.2, 10.3, 10.4, 10.5, 10.6 |
| Fix Version/s: | 10.5.14, 10.6.6, 10.7.2 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Rob Schwyzer | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
MariaDB Community 10.5 Docker Container |
||
| Issue Links: |
|
||||||||
| Description |
|
Review below walk-through for how to reproduce the issue and the error messages involved. Note it is not necessary for this to succeed- there should not be a reason to issue a COLLATE against an integer column like this. However, this behavior does not seem to be documented, so at a minimum if this is intended behavior, this should be more apparent. If this can be made to work rather than error, this will ease how much code refactoring some users must perform when switching from MySQL/Oracle to MariaDB.
|
| Comments |
| Comment by Elena Stepanova [ 2021-01-14 ] | ||||||||||||||||||||||
|
Reproducible on all of 5.5-10.6. I suppose it is not intended behavior, as it's been fixed in MySQL 5.7+, while reproducible with MySQL 5.6 as of 5.6.43 at least. bar, could you please take a look and confirm (or not)?
| ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2021-01-14 ] | ||||||||||||||||||||||
|
According to the SQL standard, COLLATE is applicable to string data types only. However, the fix is probably incomplete:
Notice, 0x31 is not a valid UCS2 string. | ||||||||||||||||||||||
| Comment by Alexander Barkov [ 2021-11-03 ] | ||||||||||||||||||||||
|
sanja, can you please review: https://github.com/MariaDB/server/tree/bb-10.5-bar-MDEV-24584 ? Thanks. | ||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2021-11-05 ] | ||||||||||||||||||||||
|
The past variant is OK to push |