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

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.055 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.