content_image/783335.jpg content_image/783336.jpg
An example of a CREATE TABLE  statement using such a comment when creating an NDB  table is shown here: 

mysql> CREATE TABLE t1 ( > c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, > c2 VARCHAR(100), > c3 VARCHAR(100) ) > ENGINE=NDB > COMMENT="NDB_TABLE=READ_BACKUP=0,PARTITION_BALANCE=FOR_RP_BY_NODE"; 

The comment is displayed as part of the ouput of SHOW CREATE TABLE . The text of the comment is also available from querying the MySQL Information Schema TABLES  table, as in this example: 

mysql> SELECT TABLE_NAME, TABLE_SCHEMA, TABLE_COMMENT > FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME="t1"\G *************************** 1. row *************************** TABLE_NAME: t1  TABLE_SCHEMA: test TABLE_COMMENT: NDB_TABLE=READ_BACKUP=0,PARTITION_BALANCE=FOR_RP_BY_NODE 1 row in set (0.01 sec) 

This comment syntax is also supported with ALTER TABLE  statements for NDB  tables, as shown here: 

mysql> ALTER TABLE t1 COMMENT="NDB_TABLE=PARTITION_BALANCE=FOR_RA_BY_NODE"; Query OK, 0 rows affected (0.40 sec) Records: 0 Duplicates: 0 Warnings: 0 

Beginning with NDB 8.0.21, the TABLE_COMMENT  column displays the comment that is required to re- create the table as it is following the ALTER TABLE  statement, like this: 

mysql> SELECT TABLE_NAME, TABLE_SCHEMA, TABLE_COMMENT -> FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME="t1"\G *************************** 1. row *************************** TABLE_NAME: t1  TABLE_SCHEMA: test TABLE_COMMENT: NDB_TABLE=READ_BACKUP=0,PARTITION_BALANCE=FOR_RP_BY_NODE 1 row in set (0.01 sec) 

mysql> SELECT TABLE_NAME, TABLE_SCHEMA, TABLE_COMMENT > FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME="t1"; 

<img src='content_image/783335.jpg'>

Keep in mind that a table comment used with ALTER TABLE  replaces any existing comment which the table might have. 

mysql> ALTER TABLE t1 COMMENT="NDB_TABLE=PARTITION_BALANCE=FOR_RA_BY_NODE"; Query OK, 0 rows affected (0.40 sec) Records: 0 Duplicates: 0 Warnings: 0 

mysql> SELECT TABLE_NAME, TABLE_SCHEMA, TABLE_COMMENT > FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME="t1"; 

<img src='content_image/783336.jpg'>

