Enable decimalV2 cast to different precision (#2131)

The precision of cast function is useless. For example,
Query: select cast(10 as decimal(1,0));
Result: 10
Although numeric field is overflow, the numeric could be return.

So, the cast function from decimal(a,b) to decimal(c,d) could not be executed.
This commit is contained in:
EmmyMiao87
2019-11-05 20:31:23 +08:00
committed by ZHAO Chun
parent 78a4270457
commit 7ad72bbcb8

View File

@ -176,7 +176,7 @@ public class CastExpr extends Expr {
Type childType = getChild(0).getType();
// this cast may result in loss of precision, but the user requested it
if (childType.equals(type)) {
if (childType.matchesType(type)) {
noOp = true;
return;
}