Hi,
During the upgrade from 3.3.5 to 4.2.1, I’ve run into the issue where I’m getting latitude and longitude distorted when querying by a column that is not the primary key.
To illustrate the problem, I’ve created the following gist:
You can run it on a clean Crate.IO instance and it will create a table with a primary key column, a string column, and a geo_point column, and then it will insert a document.
There are two tests, one querying that entry by primary key, and one by the other (non-primary key) column.
The test with primary key passes as expected, however the other test fails because the longitude/latitude precision got changed. Here’s are the log snippets:
This is correct:
2020-08-13 16:14:25,631 INFO [Test worker] GeoPointPrecisionTest: Query done, result found
2020-08-13 16:14:25,632 INFO [Test worker] GeoPointPrecisionTest: Position Object: (11.1543467,50.52103)
2020-08-13 16:14:25,634 INFO [Test worker] GeoPointPrecisionTest: Position String: (11.1543467,50.52103)
2020-08-13 16:14:25,634 INFO [Test worker] GeoPointPrecisionTest: Position PGobject: (11.1543467,50.52103)
2020-08-13 16:14:25,634 INFO [Test worker] GeoPointPrecisionTest: Position PGpoint: (11.1543467,50.52103)
This is not correct:
2020-08-13 16:14:25,640 INFO [Test worker] GeoPointPrecisionTest: Query done, result found
2020-08-13 16:14:25,641 INFO [Test worker] GeoPointPrecisionTest: Position Object: (11.154346643015742,50.52102999296039)
2020-08-13 16:14:25,641 INFO [Test worker] GeoPointPrecisionTest: Position String: (11.154346643015742,50.52102999296039)
2020-08-13 16:14:25,641 INFO [Test worker] GeoPointPrecisionTest: Position PGobject: (11.154346643015742,50.52102999296039)
2020-08-13 16:14:25,642 INFO [Test worker] GeoPointPrecisionTest: Position PGpoint: (11.154346643015742,50.52102999296039)
Because of this, I have to implement a workaround to fetch primary key column values, and then execute another query by primary key.
What am I missing?
Thanks