Bug #88530 Support metadata only column rename with NDB
Submitted: 17 Nov 2017 7:19 Modified: 1 Dec 2017 7:38
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S4 (Feature request)
Version:7.6.3 OS:Any
Assigned to: CPU Architecture:Any

[17 Nov 2017 7:19] Daniël van Eeden
Description:
In InnoDB column renames are metadata only and are instantaneous even for bigger tables.

Renaming a column is a reversible action. This is often used before permanently dropping a column (which is not reversible).

Another use case would be to re-use a column in a big table for another purpose without having to rebuild the whole table.

However in NDB it seems that this is not supported.
docs: https://dev.mysql.com/doc/refman/5.7/en/alter-table-online-operations.html
related: Bug #42002 ONLINE column rename is not supported by NDB doc. indicates otherwise.
related: Bug #80792 ALTER TABLE should support ALGORITHM=METADATA
related: WL#10761: ALTER TABLE RENAME COLUMN

Also note that the error message is wrong. It says that changing the default is not supported, but the default is not changed.

How to repeat:
CREATE TABLE `t1` (
  `c1` bigint(20) unsigned NOT NULL,
  `c2` bigint(20) unsigned NOT NULL,
  `c3` binary(16) DEFAULT NULL,
  PRIMARY KEY (`c1`),
  KEY `c2` (`c2`),
  KEY `c3` (`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;

ALTER TABLE `t1`
  CHANGE `c2` `c2_old` bigint(20) unsigned NOT NULL,
  ALGORITHM=INPLACE,
  LOCK=NONE;

ERROR 1846 (0A000): ALGORITHM=INPLACE is not supported. Reason: Altering default value is not supported. Try ALGORITHM=COPY.
[17 Nov 2017 7:21] Daniël van Eeden
Changing to S4
[1 Dec 2017 7:38] MySQL Verification Team
Hello Daniël,

Thank you for the feature request!

Thanks,
Umesh