Details
-
Bug
-
Resolution: Fixed
-
Major
-
7.1.0, 7.1.1
-
1
Description
couch_dbdump --json since MB-49817 (v7.1.0) outputs CAS as JSON number types.
While the JSON library we use (nlohmann::json) has no problem with 64bit integers, other JSON libraries / tools (such as jq) do not correctly parse these large numbers and silently discard least-significant bits / round the value. For example, note the difference in displayed CAS value with and without piping the output of couch_dbdump to jq :
install/bin/couch_dbdump --key doc_key --json ../ns_server/data/n_0/data/default/997.couch.1
|
{"body":{"json":"maybe?"},"cas":1664543368459911168, ... <cut>
|
vs
install/bin/couch_dbdump --key doc_key --json ../ns_server/data/n_0/data/default/997.couch.1 | jq -c
|
{"body":{"json":"maybe?"},"cas":1664543368459911200," ... <cut>
|
The correct CAS value of 1664543368459911168 is mangled and is rounded to 1664543368459911200.
In the specific case of jq this is a known bug and fixed in master, but is not fixed in the current latest release (1.6).
To try to mitigate these kinds of problems in future, we should change couch_dbdump to represent CAS values as stings which will not be mangled.
Attachments
Issue Links
- relates to
-
MB-49817 couch_dbdump outputs hex values with --json flag
- Closed
- links to