github-actions[bot] commented on code in PR #67306:
URL: https://github.com/apache/doris/pull/67306#discussion_r4014677022


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/Literal.java:
##########
@@ -573,6 +573,10 @@ public static Literal getLiteralByMysqlType(MysqlColType 
mysqlType, boolean isUn
             case MYSQL_TYPE_TIMESTAMP2:
                 literal = handleDateTimeLiteral(data);
                 break;
+            case MYSQL_TYPE_TINY_BLOB:

Review Comment:
   [P2] Reject missing or truncated BLOB values instead of binding changed data
   
   Routing BLOB types through `handleStringLiteral` also makes malformed value 
buffers look valid. With two non-null BLOB parameters, a values buffer of `fc 
fb 00` declares a 251-byte first value but contains no payload: `getParmLen` 
returns 251, the decoder clamps it to zero remaining bytes, the missing second 
header also becomes length zero, and execution can continue with two empty 
parameters. MySQL's reference parser rejects that missing second header. Please 
make length decoding distinguish a valid zero from a missing/partial header and 
reject payload underruns; a two-parameter negative test would cover this case.



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/Literal.java:
##########
@@ -573,6 +573,10 @@ public static Literal getLiteralByMysqlType(MysqlColType 
mysqlType, boolean isUn
             case MYSQL_TYPE_TIMESTAMP2:
                 literal = handleDateTimeLiteral(data);
                 break;
+            case MYSQL_TYPE_TINY_BLOB:
+            case MYSQL_TYPE_MEDIUM_BLOB:
+            case MYSQL_TYPE_LONG_BLOB:
+            case MYSQL_TYPE_BLOB:

Review Comment:
   [P1] Preserve binary BLOB bytes before treating them as text
   
   `MYSQL_TYPE_BLOB` is not a text-only signal: [MySQL defines it as binary 
input with no character 
conversion](https://dev.mysql.com/doc/c-api/8.4/en/c-api-prepared-statement-type-codes.html).
 A conforming client can bind the single byte `0x80` to `SELECT HEX(?)` and 
expect `80`; this branch reaches `handleStringLiteral`, where Java replaces the 
invalid UTF-8 byte with U+FFFD, so downstream evaluation sees replacement bytes 
(typically `EFBFBD`) instead. The original bytes are gone before placeholder 
coercion. Please preserve BLOB payloads as bytes and decide text conversion 
from target context, or at minimum reject invalid UTF-8 instead of silently 
changing it; add a raw-byte prepared-parameter test alongside the Unicode case.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to