[MDEV-31137] UUID type is never used for user variables Created: 2023-04-27 Updated: 2023-05-30 Resolved: 2023-05-30 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Variables |
| Affects Version/s: | 10.7, 10.8, 10.9, 10.10, 10.11 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Federico Razzoli | Assignee: | Alexander Barkov |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | uuid | ||
| Issue Links: |
|
||||||||
| Description |
|
The UUID() function correctly returns a value of type UUID. We can easily verify this with CREATE TABLE x SELECT UUID(); and SHOW CREATE TABLE x;. However, the value becomes VARCHAR if we try to assign it to a user variable:
The same happens if we try to cast the type explicitly:
This can lead to incorrect results:
|
| Comments |
| Comment by Alexander Barkov [ 2023-04-28 ] | ||||||||||
|
User variables support only four data types:
The same problem is repeatable with any other data types:
Notice, DATE was converted to VARCHAR. Supporting precise data types in user variables is currently not on our todo. |