Incorrect results returned in case of scan for min int64 value

Description

Steps:

  1. Install and configure cluster. Create bucket b1

  2. Have following documents:

3. Create index i1

create index i1 on b1(long_num)

 4. Run Following query:

 Results obtained:

Document d1 is also expected to be returned.  

Explain Plan:

5. If there is only Primary index and no secondary index on long_num, correct results are returned.

Logs: https://s3.amazonaws.com/bugdb/jira/abc/collectinfo-2018-04-24T133516-ns_1%40127.0.0.1.zip

Components

Affects versions

Fix versions

Labels

Environment

Build: 5.5.0-2556 Node 1: kv, index, n1ql

Link to Log File, atop/blg, CBCollectInfo, Core dump

None

Release Notes Description

None

Activity

Donald Haggart June 7, 2023 at 3:28 PM

This can't be addressed independently of big number support so closing it.

Donald Haggart April 6, 2022 at 11:34 AM

Our current int64 range is +/- 9223372036854775807 and does NOT include -9223372036854775808 (as this is the golang conversion error value).  Therefore -9223372036854775808 is approximated as a floating-point value, hence -9223372036854776000 being used (precision loss as explained by Sitaram).  The only possible workaround for integers less than -9223372036854775807  is to store them as a strings.

This can only practically be addressed by

Prathibha Bisarahalli October 30, 2018 at 1:37 PM
Edited

- Please clarify if Int64 in query is supported for query predicates as well. -9223372036854775808 is MinInt64 that fits into Int64 precision, hence need to be supported in lookup queries.

It works fine for MaxInt64 ie 9223372036854775807

Prathibha Bisarahalli April 24, 2018 at 1:58 PM
Edited

Sitaram, pls clarify regarding . Isn't int64 support in N1ql include query predicates as well ?

Sitaram Vemulapalli April 24, 2018 at 1:27 PM
Edited

Json there is no integers everything is numbers and any value above 2**53 will loose precision and stored as float64.
This is same as . cc

Won't Fix
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Is this a Regression?

Unknown

Triage

Untriaged

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created April 24, 2018 at 9:33 AM
Updated June 7, 2023 at 3:28 PM
Resolved June 7, 2023 at 3:28 PM
Instabug