[MDEV-27928] ERROR 1901 (HY000): Function or expression '`UUID_TO_BIN`()' cannot be used in the DEFAULT clause Created: 2022-02-23 Updated: 2022-02-24 Resolved: 2022-02-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Create Table |
| Affects Version/s: | 10.6.7 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Roger S | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Redhat 8 |
||
| Issue Links: |
|
||||||||
| Description |
|
Hi, Supposedly it is possible to run the following:
But there's an error saying:
According to https://stackoverflow.com/questions/60462208/mysql-8-0-13-default-value-as-uuid-not-working it should work on MySQL anyway. And for MariaDB, supposedly all deterministic functions should be supported in the DEFAULT clause, no? Please help, thanks! |
| Comments |
| Comment by Elena Stepanova [ 2022-02-23 ] | ||
|
MariaDB doesn't have the function. Admittedly the error message isn't very helpful, it assumes that you are trying to use a stored function or something.
The absence of the function is even explicitly documented here: | ||
| Comment by Daniel Black [ 2022-02-24 ] | ||
|
Note that 10.7 has uuids as a native type: https://mariadb.org/10-7-preview-feature-uuid-data-type/ | ||
| Comment by Roger S [ 2022-02-24 ] | ||
|
@elena: Thanks for the prompt reply! As a workaround I have just manually created the corresponding functions by using https://stackoverflow.com/a/58015720/10769628 as example. @daniel: Thanks for the hint! Too bad I'm on AWS RDS which currently only supports MariaDB up to 10.6. |