[MDEV-28826] UUID field type + WHERE EXISTS doesn't work unless CASTed Created: 2022-06-13 Updated: 2022-06-28 Resolved: 2022-06-28 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data types |
| Affects Version/s: | 10.7.4 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Gri | Assignee: | Alexander Barkov |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Environment: |
CentOS 7 + Official MariaDB 10.7 yum repository. |
||
| Issue Links: |
|
||||||||
| Description |
|
We have some strange issues with the UUID data type (introduced in MariaDB 10.7) when using WHERE EXISTS queries. Consider the following DDL:
And let's insert sample data into these tables:
Let's try to select the project by `uuid` field adding the additional constraint that it shouldn't have expired media elements in it (`created_at` < '2022-05-30').
Strange enough, but this will return an empty result. To make the query work we need to replace `project_uuid` with CAST(`project_uuid` as UUID) (CAST(`project_uuid` AS VARCHAR(100)) also works):
This works! (But CAST(), obviously, makes indexes useless and hurts performance). Is it reproducible on your side? |
| Comments |
| Comment by Alexander Barkov [ 2022-06-28 ] |
|
This problem is already fixed, see The problem is not repeatable in the current 10.7.5 code base. 10.7.5 is expected to be available for download in the end on July. |