pingcap / pingcap/tidb

The representation of 0 in division function in computing string

Open
#40,995 0 comments 0 reactions 1 assignee Claimed by @YangKeao View on GitHub
severity/moderate sig/sql-infra type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!
When we use the division function to calculate, we find that if there is a negative number type string, the result will be inconsistent with the expectation

### 1. Minimal reproduce step (Required)

select 0/-4; -- expect: 0, actual: 0.0000
select '0'/-4; -- expect: 0, actual: -0

### 2. What did you expect to see? (Required)

### 3. What did you see instead (Required)

### 4. What is your TiDB version? (Required)

5.7.25-TiDB-v6.1.2

MySQL has verified this as a bug. please see https://bugs.mysql.com/bug.php?id=109837. so I consider it is also a bug for tidb.

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.