There was a problem with large integers getting rounded because of conversion to floats in the query engine. I fixed this recently, and the fix should be available in 4.5.1.
In the current codebase, the query “SELECT 1000000 FROM default” returns a proper value 1000000, without adding a period.
Incidentally, this query only returns one row per document in the default bucket. If you always want just a single value, “SELECT 1000000” is legal N1QL and works.
curl http://localhost:8093/query/service -d "statement=select 1000000 from default"
{
"requestID": "af9e0d9a-f548-4061-98ae-ac5f4b23091f",
"signature": {
"$1": "number"
},
"results": [
{
"$1": 1000000
},
{
"$1": 1000000
}
],
"status": "success",
"metrics": {
"elapsedTime": "1.138596ms",
"executionTime": "1.109752ms",
"resultCount": 2,
"resultSize": 74
}
}
Can you wait for 4.5.1, which will have a fix?