Mysqldump does not generate Executable comment like /*! */ for shard key

Hi,

Could some one please help me to find out a way to get special comments while getting a DDL through mysqldum in 7.3.3 and above versions?

Instead of ‘SHARD KEY ID (ID)’ I want to get ‘/*!90618 , SHARD KEY ID (ID) */’

EXAMPLE for SingleStore 7.3.11 version

mysqldump -h HOST_NAME -P PORT -u USER_NAME -pPassword --add-drop-table --skip-set-charset --dump-date -d DBNAME >DBNAME.sql

The above command will generate a DDL for a table which has a shard key defined like this:

CREATE TABLE Email (
ID bigint(20) NOT NULL AUTO_INCREMENT COMMENT ‘ID’ ,
Column2 varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT ‘Column2’ KEY Column2 (Column2) USING CLUSTERED COLUMNSTORE,
SHARD KEY ID (ID)
) AUTO_INCREMENT=10 COMMENT ‘Table description’

EXAMPLE for SingleStore 7.1.18 version:

mysqldump -h HOST_NAME -P PORT -u USER_NAME -pPassword --add-drop-table --skip-set-charset --dump-date -d DBNAME >DBNAME.sql

CREATE TABLE Email (
ID bigint(20) NOT NULL AUTO_INCREMENT COMMENT ‘ID’ ,
Column2 varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT ‘Column2’ KEY Column2 (Column2) USING CLUSTERED COLUMNSTORE,
‘/*!90618 , SHARD KEY () */’
) AUTO_INCREMENT=10 COMMENT ‘Table description’

Thank you

Hi,

You can set the session variable show_with_portability_comments to get the special comments around singlestore specific syntax.

-Adam