Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latitude and Longitude should use DECIMAL datatype instead of FLOAT #4923

Closed
mgazdzik opened this issue Mar 28, 2014 · 5 comments
Closed

Latitude and Longitude should use DECIMAL datatype instead of FLOAT #4923

mgazdzik opened this issue Mar 28, 2014 · 5 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@mgazdzik
Copy link
Contributor

Recently we encountered problem with accurate lat/long storing when being passed by request parameter.

It looks like it's connected strictly with type of location_latitude and location_longitude columns.
Originally it's float and then error occurs. Altering it to decimal seems to solve problem.
How to reproduce:

  • on new Piwik instance set tracker to allow lat/long overriding:
    [Tracker]
    tracking_requests_require_authentication = 0

Then launch simpliest tracking request like:
http://local.piwik/piwik.php?idsite=1&rec=1&lat=98.23&long=-21.45

and see in database what values are stored:

lat: 98.230003
long: -21.450001

On the other hand tracker debug show proper values.

After changing schema of log_visit table and launching next request, coordinates are stored properly (lat: 98.230000, long: -21.450000)

@mattab
Copy link
Member

mattab commented Mar 31, 2014

Thanks for the report!

@mgazdzik mgazdzik added this to the 2.x - The Great Piwik 2.x Backlog milestone Jul 8, 2014
@mattab mattab removed P: low labels Aug 3, 2014
@mattab mattab modified the milestones: Short term, Mid term Sep 16, 2014
@mattab
Copy link
Member

mattab commented Apr 7, 2015

This change requires a schema upgrade to ALTER the column types, which is currently blocked: No schema change allowed on log_visit nor log_link_visit_actions nor log_action tables #6953

@mattab mattab modified the milestones: 3.0.0, Short term Jul 6, 2015
@mattab mattab modified the milestones: 3.0.0, 3.0.0-b1 Oct 1, 2015
@mattab
Copy link
Member

mattab commented Sep 23, 2016

@tsteur I went the easy route and simply cast the field to decimal. It's working good enough in our case.

@mattab
Copy link
Member

mattab commented Sep 23, 2016

Done in #10543

@mattab mattab closed this as completed Sep 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

3 participants