MySQL error 1674 even when binlog is set to ROW I am trying to alter table by doing,

ALTER TABLE Account
ADD `AccessCode` binary(16) NOT NULL  DEFAULT (UUID())


It gives me error,

Error Code: 1674. Statement is unsafe because it uses
a system function that may return a different value on the slave.


My Binlog format is Row

show variables like 'binlog_format'

--------------------------
|Variable_name  |  Value |
--------------------------
|'binlog_format'| 'ROW'  |
--------------------------


Though I will find some alternative, but why it is not allowing me? Even after setting binlog format as ROW, what is the problem here?
ALTER TABLE statements are still replicated as statements. Even with binlog_format=ROW this will be requiring the existing table populate the existing rows with an AccessCode.

I recommend:

ALTER TABLE Account ADD AccessCode binary(16) NOT NULL;
UPDATE Account SET AccessCode = UUID_TO_BIN(UUID());


This manual page says that non-determinstic default functions on columns may produce a warning or error (CURRENT_TIMESTAMP was an exception).

I'm not sure you can create this, even on the master after executing SET SESSION sql_log_bin=0; ALTER TABLE Account Alter AccessCode SET DEFAULT (UUID_TO_BIN(UUID())), I tried MySQL-8.0 however your version may differ.