Repository navigation
Fix: Render boolean functions bare in MySQL and MariaDB filters - #625
Conversation
Since 0.18 (geoalchemy#540), spatial predicates like ST_Contains have a Boolean return type. MySQL and MariaDB do not support native booleans, so SQLAlchemy rendered them as `ST_Contains(...) = 1` when used as filters, which prevents these servers from using spatial indexes (MySQL bug #76384) and leads to full table scans. Compile GeoAlchemy2 boolean functions used as filters bare on MySQL and MariaDB (`ST_Contains(...)` and `NOT ST_Contains(...)`). Other dialects keep the comparison, which is required by MSSQL and by SpatiaLite, whose predicates return -1 for NULL arguments. Other boolean expressions are not affected.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Hi @gaellegaret-joy |
|
Thanks a lot for the quick fix! I tested the branch (ccb402a) on our application (MySQL 8.0.42, SQLAlchemy 2.0.51, Python 3.12), after removing our
|
|
Great! Thank you very much for taking time to test! |
Fixes #621