[fix](Nereids) processCharacterLiteral even if both side are literal (#36729) (#36921)

pick from master #36729
This commit is contained in:
morrySnow
2024-06-28 11:01:01 +08:00
committed by GitHub
parent 0051832f91
commit 557da5b24a
3 changed files with 35 additions and 4 deletions

View File

@ -505,10 +505,6 @@ public class TypeCoercionUtils {
if (!(left instanceof Literal) && !(right instanceof Literal)) {
return (T) op.withChildren(left, right);
}
if (left instanceof Literal && right instanceof Literal) {
// process by constant folding
return (T) op.withChildren(left, right);
}
if (left instanceof Literal && ((Literal) left).isStringLikeLiteral()
&& !right.getDataType().isStringLikeType()) {
left = TypeCoercionUtils.characterLiteralTypeCoercion(