[CDRIVER-4724] Fetching data decimal data from CLOB looses precision Created: 15/Sep/23  Updated: 18/Sep/23  Resolved: 18/Sep/23

Status: Closed
Project: C Driver
Component/s: BSON
Affects Version/s: 1.21.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: arun mr Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates CDRIVER-4725 Fetching data decimal data from CLOB... Closed

 Description   

Summary

Fetching data decimal data  from CLOB looses precision

Environment

son lib 1.21.1

linuxamd64.

gcc 8

 

How to Reproduce

 

For  a data '{"a": 0.1234567890123456789012345, "b": "0.1234567890123456789012345" } after calling bson_init_from_json

 

when trying to access 'a ' we are getting 0.12345678901234568. we need full data. 

on analysis what we noticed is that the type of the data is BSON_TYPE_DOUBLE so 16 precisions are considered .

 

is this behaviour expected? is there any way to preserve the full precision. I know decfloat will, do but how can we control the conversion in  bson_init_from_json.

 

 

Additional Background

Please provide any additional background information that may be helpful in diagnosing the bug.



 Comments   
Comment by Rishabh Bisht [ 18/Sep/23 ]

Duplicate of CDRIVER-4725. Discussion can be continued in CDRIVER-4725.

Comment by PM Bot [ 15/Sep/23 ]

Hi arunmrmv@gmail.com, thank you for reporting this issue! The team will look into it and get back to you soon.

Generated at Wed Feb 07 21:21:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.