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

Clean up InnoDB GIS record comparison

    XMLWordPrintable

Details

    Description

      When the InnoDB record comparison functions were extended for SPATIAL INDEX in MySQL 5.7, the work was suboptimal for multiple reasons:

      1. The int type was being used, which does not match ulint. This triggers additional -Wconversion in some GCC versions.
      2. Many functions unnecessarily take an offsets parameter, or a parameter for length, although the size of the minimum bounding rectangle (MBR) is fixed as SPDIMS * 2 * sizeof(double), or 32 bytes. In SPATIAL INDEX records, there always is a 32-byte key followed by either a 4-byte child page number or the PRIMARY KEY value.
      3. The length parameters were not properly validated. The function cmp_geometry_field() is making an incorrect attempt at checking that the lengths are at least sizeof(double) (8 bytes), even though the function is accessing up to 32 bytes in both MBR.
      4. Functions that are called from only one compilation unit are defined in another compilation unit, making the code harder to follow and potentially slower to execute.

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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