[MDEV-33318] ORDER BY COLLATE improperly applied to non-character columns Created: 2024-01-26 Updated: 2024-01-30 |
|
| Status: | In Testing |
| Project: | MariaDB Server |
| Component/s: | Character Sets |
| Affects Version/s: | 10.5, 10.6, 10.11, 11.0, 11.1, 11.2, 11.3, 10.6.16, 10.11.6 |
| Fix Version/s: | 10.5, 10.6, 10.11, 11.0, 11.1, 11.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Vladimir "Bob" Zakharychev | Assignee: | Sergei Golubchik |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
When explicitly specifying collation on a non-character sort column , the column type is not taken into account and it may be sorted incorrectly. In 10.4 an error was thrown, but in 10.6 and 10.11 no error is thrown but sort results are unpredictable.
in 10.4 the same SQL results in
which is confusing because timestamp columns don't have collation, but at least it hints that there is a problem with the statement. Later versions silently produce wrong results instead. |
| Comments |
| Comment by Alexander Barkov [ 2024-01-29 ] | ||||||||||||||||
|
Hello serg, The patch at I suggest instead of:
to use:
|