strongduanmu commented on code in PR #4411:
URL: https://github.com/apache/calcite/pull/4411#discussion_r2136727190


##########
core/src/main/java/org/apache/calcite/sql/type/SqlTypeAssignmentRule.java:
##########
@@ -70,33 +70,73 @@ private SqlTypeAssignmentRule(
     // TINYINT is assignable from...
     rules.add(SqlTypeName.TINYINT, EnumSet.of(SqlTypeName.TINYINT));
 
+    // UTINYINT is assignable from...
+    rules.add(SqlTypeName.UTINYINT, EnumSet.of(SqlTypeName.UTINYINT));
+
     // SMALLINT is assignable from...
     rule.clear();
     rule.add(SqlTypeName.TINYINT);
+    rule.add(SqlTypeName.UTINYINT);
     rule.add(SqlTypeName.SMALLINT);
     rules.add(SqlTypeName.SMALLINT, rule);
 
+    // USMALLINT is assignable from...
+    rule.clear();
+    rule.add(SqlTypeName.UTINYINT);
+    rule.add(SqlTypeName.TINYINT);

Review Comment:
   In MySQL, the range of TINYINT is -128 ~ 127, while the range of USMALLINT 
is 0 ~ 65535. Considering that TINYINT includes negative numbers, perhaps we 
cannot assign TINYINT to USMALLINT type.



-- 
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