xuzifu666 commented on code in PR #4431:
URL: https://github.com/apache/calcite/pull/4431#discussion_r2160634639


##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -2565,6 +2568,17 @@ private static void checkConcatFunc(SqlOperatorFixture 
f) {
     f.checkString("concat('', '', 'a')", "a", "VARCHAR(1) NOT NULL");
     f.checkString("concat('', '', '')", "", "VARCHAR(0) NOT NULL");
     f.checkFails("^concat()^", INVALID_ARGUMENTS_NUMBER, false);
+
+    // test for ByteString
+    f.checkString("concat(x'61',x'62')", "0x6162", "VARCHAR(2) NOT NULL");
+    f.checkString("concat(cast(x'61' as binary), cast(x'62' as binary), "
+        + "cast(x'63' as binary))", "0x616263", "VARCHAR(3) NOT NULL");

Review Comment:
   ```ReturnTypes.MULTIVALENT_STRING_SUM_PRECISION_NULLABLE``` is directly 
judged based on the type of the passed parameter, ```x'61'``` as 
```binary(1)```, ```x'6162'``` as  ```binary(2)```. However, currently MySQL 
needs to check whether the parameter exists as a bytestring, so for the sake of 
safety, I changed it to VARCHAR_NULLABLE. @ILuffZhe 



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