matrixone icon indicating copy to clipboard operation
matrixone copied to clipboard

[Bug]: long double number lost precision

Open dengn opened this issue 3 years ago • 1 comments

Is there an existing issue for the same bug?

  • [X] I have checked the existing issues.

Environment

- Version or commit-id (e.g. v0.1.0 or 8b23a93):
- Hardware parameters:
- OS type:
- Others:

Actual Behavior

mysql> select 9999999999999999999999999999.9999999999; +-----------------------------------------+ | 9999999999999999999999999999.9999999999 | +-----------------------------------------+ | 10000000000000000000000000000 | +-----------------------------------------+ 1 row in set (0.01 sec)

Expected Behavior

mysql> select 9999999999999999999999999999.9999999999; +-----------------------------------------+ | 9999999999999999999999999999.9999999999 | +-----------------------------------------+ | 9999999999999999999999999999.9999999999 | +-----------------------------------------+

MySQL, PG, MS SQL, Snowflake all perform this way.

Steps to Reproduce

No response

Additional information

If the precision overflows the floating number, Parser should convert it to decimal. In 0.5.0, the decimal only support up to 38 digits. In 0.6.0, the decimal precision needs to be expanded.

dengn avatar Jun 30 '22 12:06 dengn

At present, in 0.6, even if '9999999999999999999999999999999.999999999999' is converted to decimal128, data truncation errors still occur,Therefore, the precision of 9999999999999999999999999999999.999999999999 cannot be guaranteed now

qingxinhome avatar Oct 12 '22 08:10 qingxinhome

@qingxinhome @dengn pls update status

sukki37 avatar Oct 29 '22 03:10 sukki37

The current version cannot be solved temporarily

qingxinhome avatar Nov 14 '22 02:11 qingxinhome

The current version cannot be solved temporarily

qingxinhome avatar Nov 22 '22 14:11 qingxinhome

The current version cannot be solved temporarily

qingxinhome avatar Nov 27 '22 10:11 qingxinhome

Not resolved yet

qingxinhome avatar Dec 01 '22 13:12 qingxinhome

Not resolved yet

qingxinhome avatar Dec 07 '22 12:12 qingxinhome

Not resolved yet

qingxinhome avatar Dec 14 '22 13:12 qingxinhome

Not resolved yet

qingxinhome avatar Dec 26 '22 14:12 qingxinhome

Decimal will handle 38 digits after refactor.

aunjgr avatar Jan 13 '23 13:01 aunjgr

Wait for decimal rewriting

aunjgr avatar Jan 20 '23 12:01 aunjgr

No progress today

aunjgr avatar Jan 31 '23 13:01 aunjgr

@zengyan1 is working on it

aunjgr avatar Feb 07 '23 11:02 aunjgr

fixed

zengyan1 avatar Mar 15 '23 08:03 zengyan1

fixed.

MO: mysql> select 9999999999999999999999999999.9999999999; +-----------------------------------------+ | 9999999999999999999999999999.9999999999 | +-----------------------------------------+ | 9999999999999999999999999999.9999999999 | +-----------------------------------------+ 1 row in set (0.01 sec)

dengn avatar Mar 20 '23 03:03 dengn