pingcap / pingcap/tidb

The representation of 0 in multiplication, pow function

Open
#42,773 1 comment 0 reactions 0 assignees View on GitHub
sig/execution type/question
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report
consider this test case:
SELECT '0'*-4; -- expected: 0, actual: -0
SELECT pow('0'*-4,3); -- expected: 0, actual: -0

When we use the multiplication, pow function to calculate, we find that if there is a negative number type string, the result will be inconsistent with the expectation

version:5.7.25-TiDB-v6.6.0

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.