924060929 commented on code in PR #69805:
URL: https://github.com/apache/doris/pull/69805#discussion_r4441485627
##########
fe/fe-core/src/main/java/org/apache/doris/qe/MysqlConnectProcessor.java:
##########
@@ -240,6 +245,22 @@ protected void handleExecute(PrepareCommand
prepareCommand, long stmtId, Prepare
packetBuf.position() - start);
}
}
+ // A string wire type still has string semantics,
including in predicates. BE can
+ // cast its original bytes to a string without the lossy
Java UTF-8 decoding.
+ if (l instanceof VarBinaryLiteral binary) {
+ switch (type) {
+ case MYSQL_TYPE_STRING:
+ case MYSQL_TYPE_VARSTRING:
+ l = new Cast(binary, StringType.INSTANCE);
Review Comment:
[P2] Keep expression-valued parameters out of literal-only fast paths
This introduces non-Literal bindings without adapting the prepared-execution
fast paths. On a point-query-eligible MOW UNIQUE table with a VARCHAR key,
execute `SELECT ... WHERE k=?` with ASCII first, then bind `FF` using the same
string wire type. `ExecuteCommand.run` reuses the cached point-query plan
before analysis, and `PointQueryExecutor:165` casts this `Cast` to `Literal`,
throwing `ClassCastException`. Prepared INSERTs with `group_commit=sync_mode`
and the default `enable_group_commit_full_prepare=true` hit the same assumption
at `GroupCommitPlanner:242`. The base produced literals for these bindings.
Gate these fast paths on the current bindings' capabilities and reset/fall back
to full planning and BE evaluation when necessary. Add coverage for both paths;
the new binding tests mock `StmtExecutor` and do not exercise them.
--
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]