Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
10.6.7
-
None
-
Redhat 8
Description
Hi,
Supposedly it is possible to run the following:
CREATE TABLE `session` (
|
`id` binary(16) NOT NULL DEFAULT (UUID_TO_BIN(UUID(), TRUE)), |
`start_timestamp` timestamp NOT NULL,
|
`end_timestamp` timestamp NULL DEFAULT NULL,
|
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
`status` varchar(20) DEFAULT NULL |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
But there's an error saying:
ERROR 1901 (HY000): Function or expression '`UUID_TO_BIN`()' cannot be used in the DEFAULT clause of `id` |
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!
Attachments
Issue Links
- relates to
-
MDEV-15854 Implement uuid_to_bin, bin_to_uuid and is_uuid functions
- Open