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

Move Field_geom from field.cc to sql_type_geom.cc

    XMLWordPrintable

Details

    Description

      To turn the implementation of the GIS data types into a plugin easier, let move Field_geom from field.h and field.cc to sql_type_geom.h and sql_type_geom.cc.

      Let's also cleanup the code in the way that Field_geom is used only in

      • sql_type_geom.h - the class definition
      • sql_type_geom.cc - the class implementation, and use cases from Type_handler_geometry
      • item_geofunc.cc - in Item_func_spatial_rel::get_mm_leaf()

      Field_geom is currently used in storage/mroonga/ha_mroonga.cpp, in cast targets. All casts targets should be changed to Field_blob, as the rest of the code uses nothing Field_geom specific.

      Field_geom is also used in handler.h, in this method:

       virtual bool can_convert_geom(const Field_geom *field,
                                     const Column_definition &new_type) const
      {
        return false;
      }
      

      Note, this method is not overloaded by any engines at the moment. So it can be removed for now. When engines will want to do instant ALTER for GEOMETRY (for example from POINT to GEOMETRY), we can restore this method, but using some generic pointer type instead of Field_geom.

      Attachments

        Activity

          People

            bar Alexander Barkov
            bar Alexander Barkov
            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.