Skip to content

[16.0][FIX] base_geoengine: pass the SRID in the geo_equal literal - #496

Open
leNeo wants to merge 1 commit into
OCA:16.0from
leNeo:16.0-fix-base_geoengine-geo_equal-srid
Open

leNeo wants to merge 1 commit into
OCA:16.0from
leNeo:16.0-fix-base_geoengine-geo_equal-srid

Conversation

@leNeo

@leNeo leNeo commented Nov 6, 2026 •

Copy link
Copy Markdown

Fixes #471.

get_geo_equal_sql built the compared geometry with ST_GeomFromText(%s), i.e. SRID 0, so a direct geo_equal domain never matched a column stored with the field SRID and silently returned an empty recordset. The literal now carries the field SRID, as _get_postgis_comp_sql already does for the other operators.

Adds test_search_equals_direct_value: the direct form of geo_equal was not covered (the existing test only uses the dict form). It fails before the fix and passes after; full module suite green locally with PostGIS.

Thanks @lesdekock for the report and the analysis. Forward-ports to 17.0, 18.0 and 19.0 will follow.

get_geo_equal_sql built the compared geometry with ST_GeomFromText(%s),
without an SRID. PostGIS then creates the literal with SRID 0, which is
never equal to a column stored with the field's SRID, so a direct
geo_equal domain always returned an empty recordset, silently.

Pass the field SRID as the other spatial operators already do in
_get_postgis_comp_sql, and add a regression test for the direct
(non-dict) form of geo_equal, which was not covered.

Fixes OCA#471
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants