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

Wrong result with ST_Disjoint, InnoDB only

    XMLWordPrintable

Details

    • Unexpected results

    Description

      Setup:

      CREATE TABLE t1 (id int PRIMARY KEY, g geometry NOT NULL, SPATIAL KEY(g))
        ENGINE=InnoDB;
      INSERT INTO t1 VALUES
       (1, ST_GeomFromText('POLYGON((0 0,10 0,0 10,0 0))')),
       (2, ST_GeomFromText('POLYGON((100 100,101 100,101 101,100 101,100 100))'));
      SET @p= ST_GeomFromText('POLYGON((8 8,9 8,9 9,8 9,8 8))');
      

      On 11.4 we are missing a result for ST_Disjoint:

      MariaDB [test]> SELECT id FROM t1 WHERE ST_Disjoint(@p,g);
      +----+
      | id |
      +----+
      |  2 |
      +----+
      1 row in set (0.001 sec)
      

      Contrasted with MySQL 9.6.0:

      mysql> SELECT id FROM t1 WHERE ST_Disjoint(@p,g);
      +----+
      | id |
      +----+
      |  1 |
      |  2 |
      +----+
      2 rows in set (0.002 sec)
      

      Interestingly, this appears to be specific to InnoDB. Changing the engine to MyISAM or Aria gives the same result that MySQL gives.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Gosselin Dave Gosselin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

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

                Git Integration

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