String Functions
MySQL |
GaussDB |
Difference |
---|---|---|
ASCII() |
Supported. |
- |
BIT_LENGTH() |
Supported. |
- |
CHAR_LENGTH() |
Supported, with differences. |
In GaussDB, if the character set is SQL_ASCII, CHAR_LENGTH() returns the number of bytes instead of characters. |
CHARACTER_LENGTH() |
Supported, with differences. |
In GaussDB, if the character set is SQL_ASCII, CHARACTER_LENGTH() returns the number of bytes instead of characters. |
CONCAT() |
Supported, with differences. |
For binary return values, MySQL offers various options (including BINARY, VARBINARY, and BLOB), while GaussDB offers only one—LONGBLOB. For non-binary return values, MySQL offers various options (including CHAR, VARCHAR, and TEXT), while GaussDB only offers TEXT. |
CONCAT_WS() |
Supported, with differences. |
For binary return values, MySQL offers various options (including BINARY, VARBINARY, and BLOB), while GaussDB offers only one—LONGBLOB. For non-binary return values, MySQL offers various options (including CHAR, VARCHAR, and TEXT), while GaussDB only offers TEXT. |
HEX() |
Supported. |
- |
LENGTH() |
Supported. |
- |
LPAD() |
Supported, with differences. |
|
REPEAT() |
Supported, with differences. |
For binary return values, MySQL offers various options (including BINARY, VARBINARY, and BLOB), while GaussDB offers only one—LONGBLOB. For non-binary return values, MySQL offers various options (including CHAR, VARCHAR, and TEXT), while GaussDB only offers TEXT. |
REPLACE() |
Supported, with differences. |
For binary return values, MySQL offers various options (including BINARY, VARBINARY, and BLOB), while GaussDB offers only one—LONGBLOB. For non-binary return values, MySQL offers various options (including CHAR, VARCHAR, and TEXT), while GaussDB only offers TEXT. |
RPAD() |
Supported, with differences. |
|
SPACE() |
Supported. |
- |
STRCMP() |
Supported, with differences. |
When GaussDB uses the SQL_ASCII, the server interprets byte values 0 to 127 according to the ASCII standard, and byte values 128 to 255 are regarded as characters that cannot be parsed. If the input and output of the function contain any non-ASCII data, the database cannot convert or verify non-ASCII characters. As a result, the behavior of the function is greatly different from that of MySQL. |
FIND_IN_SET() |
Supported, with differences. |
When GaussDB uses the SQL_ASCII, the server interprets byte values 0 to 127 according to the ASCII standard, and byte values 128 to 255 are regarded as characters that cannot be parsed. If the input and output of the function contain any non-ASCII data, the database cannot convert or verify non-ASCII characters. As a result, the behavior of the function is greatly different from that of MySQL. For binary return values, MySQL offers various options (including BINARY, VARBINARY, and BLOB), while GaussDB offers only one—LONGBLOB. For non-binary return values, MySQL offers various options (including CHAR, VARCHAR, and TEXT), while GaussDB only offers TEXT. |
LCASE() |
||
LEFT() |
||
LOWER() |
||
LTRIM() |
||
REVERSE() |
||
RIGHT() |
||
RTRIM() |
||
SUBSTR() |
||
SUBSTRING() |
||
SUBSTRING_INDEX() |
||
TRIM() |
||
UCASE() |
||
UPPER() |
||
UNHEX() |
Supported, with differences. |
The return value type in MySQL is BINARY, VARBINARY, BLOB, MEDIUMBLOB, or LONGBLOB, while the return value type in GaussDB is fixed to LONGBLOB. |
FIELD() |
Supported. |
- |
FORMAT() |
Supported. |
- |
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