Bug #112153 ADD COLUMN with expressional DEFAULT does not support online ALTER TABLE
Submitted: 23 Aug 2023 7:30 Modified: 23 Aug 2023 7:51
Reporter: Tsubasa Tanaka (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:8.0.34,8.1.0 OS:Any
Assigned to: CPU Architecture:Any

[23 Aug 2023 7:30] Tsubasa Tanaka
Description:
This is documentation issue.

ADD COLUMN with expressional DEFAULT does not support online ALTER TABLE.
But the documentation doesn't describe it.

https://dev.mysql.com/doc/refman/8.0/en/innodb-online-ddl-operations.html
https://dev.mysql.com/doc/refman/8.1/en/innodb-online-ddl-operations.html

How to repeat:
CREATE TABLE t1 (num serial, val varchar(32));

mysql81 54> ALTER TABLE t1 ADD c varchar(32) DEFAULT ('{}'), ALGORITHM= INSTANT;
ERROR 1845 (0A000): ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=COPY/INPLACE.

mysql81 54> ALTER TABLE t1 ADD c varchar(32) DEFAULT ('{}'), ALGORITHM= INPLACE;
ERROR 1845 (0A000): ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.

Suggested fix:
Add description of this limitation into the document.

https://dev.mysql.com/doc/refman/8.0/en/innodb-online-ddl-operations.html
https://dev.mysql.com/doc/refman/8.1/en/innodb-online-ddl-operations.html
[23 Aug 2023 7:51] MySQL Verification Team
Hello tanaka-San,

Thank you for the report and feedback.

regards,
Umesh