Bug #120237 DEFAULT(UUID()) allowed at CREATE TABLE but rejected in ALTER TABLE with binary logging enabled
| Submitted: | 8 Apr 17:05 | Modified: | 9 Apr 8:59 |
|---|---|---|---|
| Reporter: | João Martins | Email Updates: | |
| Status: | Documenting | Impact on me: | |
| Category: | MySQL Server: DDL | Severity: | S3 (Non-critical) |
| Version: | 9.6 and 8.4 | OS: | Any |
| Assigned to: | CPU Architecture: | Any |
[8 Sep 8:48]
MySQL Admin
Posted by developer: Bug status updated to 'Documenting'
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.048 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: Non‑deterministic DEFAULT expressions (e.g. UUID()) are accepted when defined at CREATE TABLE time, but rejected when the same DEFAULT is added via ALTER TABLE, even when binary logging is enabled in ROW mode. This behaviour might be intentional (for replication safety?), but I did not found explicitly documented it can also be a bug. How to repeat: CREATE TABLE t1 ( i INT, b BINARY(16) DEFAULT (UUID_TO_BIN(UUID()))-- This succeeds ); ALTER TABLE t1 ADD COLUMN c BINARY(16) DEFAULT (UUID_TO_BIN(UUID(), 1)); -- This fails with: ERROR 1674 (HY000)