[MDEV-25377] JSON_TABLE: Wrong value with implicit conversion Created: 2021-04-09 Updated: 2021-04-20 Resolved: 2021-04-18 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | JSON |
| Affects Version/s: | N/A |
| Fix Version/s: | 10.6.0 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Elena Stepanova | Assignee: | Alexey Botchkov |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Description |
|
In all queries below, the value 1 is valid for the tinyint column, while the values "foo" and 1000 are not, so they get implicitly converted. The first query, without ORDER BY, converts both to NULL and returns them in the order of appearance:
However, the same query with ORDER BY (by either column) converts 1000 to NULL, but "foo" to 0:
Moreover, if the converted values are used in ORDER BY, the final order appears to be incorrect:
(In fact, 0 is probably still NULL during ORDER BY, hence the order, but it doesn't look right). |
| Comments |
| Comment by Sergei Petrunia [ 2021-04-13 ] | ||||||||||||
|
Ok the rows are sorted correctly. The reason for bad result with ORDER BY is that the row is not decoded correctly from the rowid. Idea of a fix:
| ||||||||||||
| Comment by Sergei Petrunia [ 2021-04-18 ] | ||||||||||||
|
Fixed by fix for |