Details
-
Bug
-
Resolution: Fixed
-
Major
-
4.5.1
-
Triaged
-
Unknown
Description
Steps To Reproducing
Execute the following Java Code using version 2.3.1 of the SDK, it will create two documents, one via N1QL, the other via counter()
import com.couchbase.client.java.*; |
import com.couchbase.client.java.document.*; |
import com.couchbase.client.java.document.json.*; |
import com.couchbase.client.java.query.*; |
import com.couchbase.client.java.query.N1qlQuery.*; |
import java.lang.Thread; |
public class Example { |
public static void main(String... args) throws Exception { |
Cluster cluster = CouchbaseCluster.create("10.112.151.102"); |
Bucket bucket = cluster.openBucket("default"); |
System.out.println(bucket.counter("Java:Counter", 1, 1073741824)); |
N1qlQueryResult result = bucket.query( |
N1qlQuery.simple("UPSERT INTO default (KEY, VALUE) VALUES (\"N1QL:Counter\", 1073741824) RETURNING *") |
); |
for (N1qlQueryRow row : result) { |
System.out.println(row); |
} |
} |
{color:#000000}}| Problem The document created via the N1QL query, is a string in science notation and not a integer, this can be seen from the raw dump of the couchstore files: |[root@node2-cb451-centos7 default]# /opt/couchbase/bin/couch_dbdump 749.couch.1 |
Dumping "749.couch.1": |
Doc seq: 1 |
id: N1QL:Counter |
rev: 1 |
content_meta: 128 |
size (on disk): 25 |
cas: 1486943690859020288, expiry: 0, flags: 0, datatype: 1, conflict_resolution_mode: 0 |
size: 15 |
data: (snappy) 1.073741824e+09 |
Total docs: 1 |
[root@node2-cb451-centos7 default]# /opt/couchbase/bin/couch_dbdump 874.couch.1 |
Dumping "874.couch.1": |
Doc seq: 1 |
id: Java:Counter |
rev: 1 |
content_meta: 128 |
size (on disk): 20 |
cas: 1486943690766680064, expiry: 0, flags: 0, datatype: 1, conflict_resolution_mode: 0 |
size: 10 |
data: (snappy) 1073741824 |
Total docs: 1 |
Unfortunately the UI incorrectly expands the science notation:
Expectation
For the UI to show the real value i.e the science notation
Attachments
Issue Links
- depends on
-
MB-23546 Return exact payload from "docs" API and show document in UI exactly as it is in the database (was: erlang document bignum and num with floating point issues)
- Closed