Skip to content

MDEV-40584 ST_CROSSES always returns 0 for different-dimension geometries - #5494

Merged
forkfun merged 1 commit into
10.11from
bb-10.11-MDEV-40584
Aug 11, 2026
Merged

MDEV-40584 ST_CROSSES always returns 0 for different-dimension geometries#5494
forkfun merged 1 commit into
10.11from
bb-10.11-MDEV-40584

Conversation

@forkfun

@forkfun forkfun commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

MDEV-36058 added a dimension-equality check ("Both geometries must
have the same number of dimensions") for SP_OVERLAPS_FUNC, but a
stray fall-through from SP_CROSSES_FUNC into that same case made
CROSSES share it too. CROSSES is defined precisely for geometries
of different dimensions, so any such pair now hit
"if (g1_dim != g2_dim) DBUG_RETURN(0)" and always returned 0.

Give SP_CROSSES_FUNC its own case again, calling
handle_sp_crosses_func_case() directly without the dimension check.
SP_OVERLAPS_FUNC keeps the check.

…ries

MDEV-36058 added a dimension-equality check ("Both geometries must
have the same number of dimensions") for SP_OVERLAPS_FUNC, but a
stray fall-through from SP_CROSSES_FUNC into that same case made
CROSSES share it too. CROSSES is defined precisely for geometries
of different dimensions, so any such pair now hit
"if (g1_dim != g2_dim) DBUG_RETURN(0)" and always returned 0.

Give SP_CROSSES_FUNC its own case again, calling
handle_sp_crosses_func_case() directly without the dimension check.
SP_OVERLAPS_FUNC keeps the check.
@forkfun
forkfun force-pushed the bb-10.11-MDEV-40584 branch from 250a231 to b608e10 Compare August 11, 2026 09:29
@forkfun
forkfun merged commit b608e10 into 10.11 Aug 11, 2026
16 of 17 checks passed
@forkfun
forkfun deleted the bb-10.11-MDEV-40584 branch August 11, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants