Skip to content

Commit d6e3bda

Browse files
nokiaMSgithubgxll
authored andcommitted
[fix][runtime] Make mod compitible with mysql.
1 parent a82066f commit d6e3bda

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • runtime/src/main/java/io/dingodb/expr/runtime/op/mathematical

runtime/src/main/java/io/dingodb/expr/runtime/op/mathematical/ModFun.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ abstract class ModFun extends BinaryNumericOp {
3737
return value1 != 0 ? value0 % value1 : null;
3838
}
3939

40-
static @Nullable float mod(float value0, float value1) {
40+
static @Nullable Float mod(float value0, float value1) {
4141
if (value1 == 0) {
42-
return value0;
42+
return null;
4343
}
4444
return (float)(value0 % value1);
4545
}
4646

47-
static @Nullable double mod(double value0, double value1) {
47+
static @Nullable Double mod(double value0, double value1) {
4848
if (value1 == 0) {
49-
return value0;
49+
return null;
5050
}
5151
return (double)(value0 % value1);
5252
}

0 commit comments

Comments
 (0)