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

MDEV-17398 Implement ST_LatFromGeoHash and ST_LongFromGeoHash #3169

Open
wants to merge 1 commit into
base: 11.5
Choose a base branch
from

Conversation

3abqreno
Copy link

@3abqreno 3abqreno commented Apr 1, 2024

Porting ST_LatFromGeoHash and ST_LongFromGeoHash from MySQL

  • The Jira issue number for this PR is: MDEV-17398

Description

This PR ports two functions ST_LatFromGeoHash and ST_LongFromGeoHash from MySQL, the implementation was taken from item_geofunc.cc and item_geofunc.h, there were some changes to make the code work with MariaDB codebase.

How can this PR be tested?

Ported tests from MySQL from geohash_functions.test and geohash_functions.result.

the new tests were added to a file called gis_geohash_functions.test and gis_geohash_functions.result.

Basing the PR against the correct MariaDB version

  • This is a new feature and the PR is based against the latest MariaDB development branch.

PR quality check

  • I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

@3abqreno 3abqreno force-pushed the LatLongFromGeoHash-functions-MDEV-17398 branch from 0179abe to d7c9102 Compare April 1, 2024 21:31
@grooverdan
Copy link
Member

related #2570.

Would be good to attribute original authors of code base and reference the MySQL commits in the commit message.

sql/item_geofunc.h Outdated Show resolved Hide resolved
@3abqreno 3abqreno force-pushed the LatLongFromGeoHash-functions-MDEV-17398 branch from d7c9102 to bf8c552 Compare April 3, 2024 20:58
@3abqreno
Copy link
Author

3abqreno commented Apr 3, 2024

@grooverdan I have looked into the other PR and tried to and tried to add the original author to the commit but I couldn't find their email in github, you can find the original implementation PR here, I have added their name and commit hash to the commit message is that enough?

Copy link
Contributor

@HugoWenTD HugoWenTD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A minor typo in commit message, MaraiDB -> MariaDB:

I did some very small changes in the class structure to make the code work with MaraiDB.

@robinnewhouse
Copy link
Contributor

Regarding the author attribution, https://github.com/mysql/mysql-server/commit/ad34780e.patch shows [email protected]
I would suggest adding the email and full link to the commit.

@3abqreno 3abqreno force-pushed the LatLongFromGeoHash-functions-MDEV-17398 branch 2 times, most recently from 2a4fed1 to 8df3342 Compare April 4, 2024 14:14
@3abqreno
Copy link
Author

3abqreno commented Apr 4, 2024

@HugoWenTD Thanks for noticing the typo.

@robinnewhouse Thank you I didn't know about the .patch thing it's very useful, I have made him the author as suggested in the other geohash function PR and I am now co-author.
I have also added the original commit link in the commit message.

@3abqreno
Copy link
Author

3abqreno commented Apr 7, 2024

@grooverdan I have done what people asked in the code review, should I wait for another review?
I also have another question about the failing test, the 11.5 branch itself fails some tests so should I work on making them work? If I have to fix them how should I do that since they are on other distributions and on my PC the tests pass.

@LinuxJedi
Copy link
Contributor

I also have another question about the failing test, the 11.5 branch itself fails some tests so should I work on making them work? If I have to fix them how should I do that since they are on other distributions and on my PC the tests pass.

There are known issues here that are being worked on. I don't think you have triggered these, although this can be confirmed the next time we review it.

@3abqreno 3abqreno force-pushed the LatLongFromGeoHash-functions-MDEV-17398 branch from 8df3342 to e82e475 Compare April 12, 2024 01:29
This commit ports ST_LatFromGeoHash and ST_LongFromGeoHash from MySQL.

This code was ported from MySQL, the original author of the functions is Erik Froseth.
The original functions commit mysql/mysql-server@ad34780e.

I did some very small changes in the class structure to make the code work with MariaDB.

Co-authored-by: 3abqreno [email protected]
@LinuxJedi LinuxJedi force-pushed the LatLongFromGeoHash-functions-MDEV-17398 branch from e82e475 to 9f6b4e8 Compare May 8, 2024 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants