Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-40584

ST_CROSSES always returns 0 for geometries of different dimensions

    XMLWordPrintable

Details

    • Bug
    • Status: Stalled (View Workflow)
    • Blocker
    • Resolution: Unresolved
    • 10.11.17, 10.11.18, 11.4.11, 11.4.12, 11.8.7, 11.8.8, 12.3.2
    • 10.11, 11.4, 11.8, 12.3
    • GIS
    • Unexpected results
    • Q3/2026 Server Development

    Description

      Version 11.4.11 introduced a regression in ST_Crosses:

      SELECT ST_Crosses(ST_GeomFromText('MULTIPOINT(1 3, 2 2, 3 2)'),
                        ST_GeomFromText('LINESTRING(0 3, 1 1, 2 2, 2 0)'));
      -- expected: 1
      -- actual  : 0
       
      SELECT ST_Crosses(ST_GeomFromText('MULTIPOINT(1 1, 1 3, 2 3)'),
                        ST_GeomFromText('POLYGON((0 0, 0 3, 2 0, 0 0))'));
      -- expected: 1
      -- actual  : 0
       
      SELECT ST_Crosses(ST_GeomFromText('LINESTRING(0 1, 3 2, 4 1)'),
                        ST_GeomFromText('POLYGON((1 0, 1 2, 2 3, 2 1, 1 0))'));
      -- expected: 1
      -- actual  : 0
      

      All three queries return 1 on MariaDB 11.4.10 and earlier, and on MySQL 8.4.7 and 9.6.0. PostGIS (3.5.2 and 3.6.4) and GEOS (3.10.2 and 3.14.1) also report these geometries as crossing.

      Starting with 11.4.11, MariaDB returns 0 for every ST_CROSSES call where the two geometries have different dimensions.

      ST_Overlaps requires geometries of the same dimension, but ST_Crosses is defined precisely for geometries of different dimensions.

      This regression seems to have been introduced by MDEV-36058.

      Attachments

        Activity

          People

            alice Alice Sherepa
            BenMorel Benjamin Morel
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 0d
                0d
                Remaining:
                Remaining Estimate - 1d
                1d
                Logged:
                Time Spent - Not Specified
                Not Specified

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.