U0400032: GaussDB partially supports the CONVERT function
Description
Database Type and Version
- Source database type and version: MySQL 5.5, 5.6, 5.7, and 8.0
- Target database type and version: all GaussDB versions
Syntax Example
The CONVERT function is not supported in GaussDB (B-compatible mode) of versions earlier than V2.0-8.0 and is supported in GaussDB (B-compatible mode) 8.0 and GaussDB (M-compatible mode). The function name needs to be changed.
In MySQL, CONVERT can be used in two ways.
Methods 1: Convert the expression type to another, for example:
SELECT CONVERT('123', SIGNED);
In GaussDB of versions that do not support CONVERT, it will be converted to the CAST function, for example:
SELECT CAST('123' AS BIGINT);
Method 2: Use the USING clause to convert a string from one character set to another, for example:
SELECT CONVERT ('Hello' USING utf8);
In GaussDB of versions that do not support CONVERT, it will be converted to the CONVERT_FROM function, for example:
SELECT CONVERT_FROM ('Hello', 'utf8');
However, when the type and character set is converted to those not supported by GaussDB, UGO retains the CONVERT function and reports this error. The following example shows that the type or character set of MySQL is not supported by GaussDB.
SELECT CONVERT('123', UNSIGNED); SELECT CONVERT('abc' USING ascii);
Even in GaussDB versions that support the CONVERT function, some data types (UNSIGNED and BINARY) and character sets are still not supported. For details about the character sets supported by GaussDB, see GaussDB Developer Guide.
Suggestion
No solution is available. You are advised to refactor application code.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot