This commit is contained in:
yanhuqing
2020-08-06 19:30:35 +08:00
parent daad8e64a5
commit 18928b0147
2 changed files with 8 additions and 0 deletions
@@ -6,6 +6,7 @@
package com.actiontech.dble.plan.common.item.function.mathsfunc;
import com.actiontech.dble.plan.common.item.Item;
import com.actiontech.dble.plan.common.item.ItemInt;
import com.actiontech.dble.plan.common.item.function.ItemFunc;
import java.util.List;
@@ -19,6 +20,9 @@ public class ItemFuncRound extends ItemFuncRoundOrTruncate {
@Override
public ItemFunc nativeConstruct(List<Item> realArgs) {
if (realArgs != null && realArgs.size() == 1) {
realArgs.add(new ItemInt(0));
}
return new ItemFuncRound(realArgs);
}
@@ -6,6 +6,7 @@
package com.actiontech.dble.plan.common.item.function.mathsfunc;
import com.actiontech.dble.plan.common.item.Item;
import com.actiontech.dble.plan.common.item.ItemInt;
import com.actiontech.dble.plan.common.item.function.primary.ItemFuncNum1;
import java.math.BigDecimal;
@@ -18,6 +19,9 @@ public abstract class ItemFuncRoundOrTruncate extends ItemFuncNum1 {
public ItemFuncRoundOrTruncate(List<Item> args, boolean truncate) {
super(args);
if (this.args != null && this.args.size() == 1) {
this.args.add(new ItemInt(0));
}
this.truncate = truncate;
}