Updated on 2025-06-07 GMT+08:00

U0400025: GaussDB does not support the SET data type

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: GaussDB Centralized (B-compatible mode) V2.0-3.1 or earlier, GaussDB (M-compatible mode) V2.0-8.100, and GaussDB Distributed

Syntax Example

In the following example, the SET data type is used in the CREATE TABLE statement. If a GaussDB version that does not support the SET data type is selected, this error is reported.

CREATE TABLE set_test (
    id int NOT NULL PRIMARY KEY,
    set_test set('A', 'B', 'C') DEFAULT NULL
);

Suggestion

Modify set datatype conversion. You can convert the SET data type to VARCHAR and add a trigger to verify data. If no trigger is added, service data integrity must be guaranteed. If a trigger is added, the performance may be affected and the database system may be difficult to maintain. Therefore, you need to fully evaluate the impact on services.

By default, in MySQL and GaussDB (M-compatible mode), set_test can be set to a, b, c, or an empty string, which is not allowed in GaussDB (B-compatible mode). Whether the value is case sensitive depends on the default case-sensitive behavior of the database. For details, see U0400023: GaussDB does not support BINARY.