[Bug](decimalv2) getCmpType return decimalv2 when lhs/rhs type both is decimalv2 (#26705)

getCmpType return decimalv2 when lhs/rhs type both is decimalv2
This commit is contained in:
Pxl
2023-11-10 16:21:28 +08:00
committed by GitHub
parent 59efebce3b
commit 2712bb9f60
2 changed files with 26 additions and 0 deletions

View File

@ -451,6 +451,12 @@ public class BinaryPredicate extends Predicate implements Writable {
return Type.getAssignmentCompatibleType(getChild(0).getType(), getChild(1).getType(), false,
SessionVariable.getEnableDecimal256());
}
if (t1 == PrimitiveType.DECIMALV2 && t2 == PrimitiveType.DECIMALV2) {
return ScalarType.getAssignmentCompatibleDecimalV2Type((ScalarType) getChild(0).getType(),
(ScalarType) getChild(1).getType());
}
if ((t1 == PrimitiveType.BIGINT && t2 == PrimitiveType.DECIMALV2)
|| (t2 == PrimitiveType.BIGINT && t1 == PrimitiveType.DECIMALV2)
|| (t1 == PrimitiveType.LARGEINT && t2 == PrimitiveType.DECIMALV2)