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)
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)