When CDM Is Used to Import MySQL Data to GaussDB(DWS), the Column Length Exceeds the Threshold and Data Synchronization Fails
Symptom
In MySQL 5.x, the column length is VARCHAR(n). When CDM is used to synchronize data to GaussDB(DWS) and the column length is set to VARCHAR(n), the column length exceeds the threshold and data synchronization fails.
Possible Causes
- In versions earlier than MySQL 5.0.3, n in VARCHAR(n) indicates the number of bytes.
- In MySQL 5.0.3 and later, n in VARCHAR(n) indicates the number of characters. For example, VARCHAR(200) indicates that a maximum of 200 English or Chinese characters can be stored.
- For GaussDB(DWS), n in VARCHAR(n) indicates the number of bytes.
Each GBK character occupies two bytes and each UTF-8 character occupies a maximum of three bytes. Based on the conversion rule, for the same column length, the length may exceed the threshold on GaussDB(DWS).
Handling Procedure
If the MySQL column is VARCHAR(n), set the column length of GaussDB(DWS) to VARCHAR(n*3).
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.