When using sync_diff_inspector to check if the table structures are consistent, an error occurred: “[2023/09/15 16:07:36.843 +08:00] [FATAL] [main.go:129] [“failed to check structure difference”] [error=”[ddl:1629]Comment for field ‘event’ is too long (max = 1024)“] [errorVerbose=”[ddl:1629]Comment for field ‘event’ is too long (max = 1024)\ngithub.com/pingcap/errors.AddStack\n\t/go/pkg/mod/github.com/pingcap/errors@v0.11.5-0.20221009092201-b66cddb77c32/errors.go:174\ngithub.com/pingcap/errors.(*Error)"
Is the event field comment too long? This should be a MySQL prompt.
Found from MySQL:
For tables: The table comment can be up to 2048 characters long.
For columns: You can use the COMMENT option to specify a column comment, up to 1024 characters long.
For INDEX: In MySQL 5.6, index definitions can include an optional comment of up to 1024 characters.
For PARTITION: Starting from MySQL 5.6.6, the maximum length of a partition comment is 1024 characters (previously this limit was not clearly defined).
SELECT
ROW_NUMBER() OVER (order by ORDINAL_POSITION) AS No,
TABLE_SCHEMA AS DatabaseName, TABLE_NAME AS TableName,
COLUMN_NAME AS Column, DATA_TYPE AS Type,
IFNULL(IFNULL(CHARACTER_MAXIMUM_LENGTH, NUMERIC_PRECISION), '') AS Length,
IFNULL(NUMERIC_SCALE, '') AS DecimalPoint,
CASE WHEN IS_NULLABLE = 'NO' THEN '√' ELSE '' END AS IsRequired,
IFNULL(COLUMN_DEFAULT, '') AS DefaultValue,
CASE WHEN COLUMN_KEY = 'PRI' THEN '√' ELSE '' END AS PrimaryKey,
IFNULL(COLUMN_COMMENT, '') AS Comment
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME = 'event'
ORDER BY ORDINAL_POSITION;
Thank you for the reply. I checked and indeed found that the comment for the event field in one of the tables is very long, exceeding 1024 characters. Is there still a way to validate this situation?
# (Optional) Ignore the check of certain columns, such as some types that sync-diff-inspector currently does not support (json, bit, blob, etc.)
# Or floating-point type data may have differences in performance between TiDB and MySQL, you can use ignore-columns to ignore the check of these columns
ignore-columns = ["",""]
Yes, [2023/09/15 17:40:15.552 +08:00] [FATAL] [main.go:129] [“failed to check structure difference”] [error=“[ddl:1629]Comment for field ‘event’ is too long (max = 1024)”] [errorVerbose="[ddl:1629]Comment for field ‘event’ is too long (max = 1024)\ngithub.com/pingcap/errors.AddStack\n\t/go/pkg/mod/github.com/pingcap/errors@v0.11.5-0.20221009092201-b66cddb77c32/errors.go:174\ngithub.com/pingcap/errors.(*Error)