yuanoOo commented on code in PR #186:
URL: 
https://github.com/apache/flink-connector-jdbc/pull/186#discussion_r2744980855


##########
flink-connector-jdbc-oceanbase/src/test/java/org/apache/flink/connector/jdbc/oceanbase/database/catalog/OceanBaseMysqlCatalogITCase.java:
##########
@@ -200,7 +200,7 @@ private static TableRow createTableAllTypeTable(String 
tableName) {
                         DataTypes.DECIMAL(11, 0)),
                 field("col_double", dbType("double"), DataTypes.DOUBLE()),
                 field("col_double_unsigned", dbType("double unsigned"), 
DataTypes.DOUBLE()),
-                field("col_enum", dbType("enum('enum1','enum2','enum11')"), 
DataTypes.VARCHAR(6)),
+                field("col_enum", dbType("enum('enum1','enum2','enum11')"), 
DataTypes.CHAR(6)),

Review Comment:
   Hi @davidradl and @snuyanzin,
   I’ve double-checked the behavior in OceanBase. The change from VARCHAR to 
CHAR for ENUM and SET types is indeed an intentional change introduced in 
OceanBase 4.3.x.
   Root Cause: OceanBase's kernel changed the JDBC type mapping for ENUM and 
SET from java.sql.VARCHAR to java.sql.CHAR between versions 4.2.1-LTS and 
4.3.5-LTS. This aligns OceanBase's behavior with MySQL's behavior, where ENUM 
and SET are also mapped to CHAR.
   
   The underlying nature of ENUM and SET types (fixed set of possible values 
with fixed-length storage representation) is fundamentally closer to CHAR than 
VARCHAR. This change in 4.3.x corrects the previous inconsistent mapping.
   The test case update is necessary to accommodate this version-specific 
behavior change in OceanBase's type system.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to