pingcap / pingcap/tidb

The problem of the representation of zero in the MOD function

Open
#39,260 2 comments 0 reactions 0 assignees View on GitHub
severity/moderate sig/execution type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

Consider the following statements:

```
SELECT mod(-12,-4); -- expected: 0, actual: 0
SELECT mod('-12',-4); -- expected: 0, actual: -0
```

the result of these two test cases is different, We expect them to be the same.

database version : 5.7.25-TiDB-v6.1.2

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.