Closed tomkcook closed 2 weeks ago
TBH I struggle a bit to articulate a test that would fail without this change and pass with it, at least within the current test regime. I can see two options:
test_functional_mariadb.py
that replicates most of test_functional_mysql.py
but with a MariaDB database instead of a MySQL one.reflect_geometry_column()
specifically, mock out the engine and check that the executed SQL includes the SRS_ID column if the dialect is MySQL but not if it's MariaDB.Do the maintainers have a preference for which approach to take?
Hi @tomkcook,
Sorry for the delay, I'm currently on vacation.
Thank you very much for pointing this issue out and for proposing a solution. As far as I can see, your solution looks good but it could be reworked to be a bit more compact and to avoid duplicated code. And for your question, I think that just one test for reflect_geometry_column
is enough.
I will have some time next week to review this more carefully.
Hi @tomkcook ! I made a few tests in https://github.com/geoalchemy/geoalchemy2/pull/524 and I realized that MariaDB was not as close to MySQL as I expected, so I think it should be processed as a complete different dialect. Nevertheless, there is something I don't understand: I could not find a way to insert a geometry using a WKB string, is it possible? Otherwise we will have to convert all WKB strings into WKT strings, which is quite bad for perf.
Hi @tomkcook ! I think #524 solved most of the issues with MariaDB, could you test it in your workflow to ensure everything is all right please?
This PR was included in #524 so it can be closed now. Thanks again for your work @tomkcook !
Description
Fixes: #521
This resolves #521 -- at least for me -- by adding a MariaDB-specific query for geometry column reflection.
Apologies that I am out of time today to add a test case. I'll look into it tomorrow.
Checklist
This pull request is:
Fixes: #<issue number>
in the description if it solves an existing issue (which must include a complete example of the issue).main
branch and pass with the provided fix.Fixes: #<issue number>
in the description if it solves an existing issue (which must include a complete example of the feature).