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

Move Field_geom from field.cc to sql_type_geom.cc

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

          bar Alexander Barkov created issue -
          bar Alexander Barkov made changes -
          Field Original Value New Value
          Rank Ranked higher
          bar Alexander Barkov made changes -
          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.
          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:
          {code:cpp
           virtual bool can_convert_geom(const Field_geom *field,
                                         const Column_definition &new_type) const
          {
            return false;
          }
          {code}
          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.
          bar Alexander Barkov made changes -
          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:
          {code:cpp
           virtual bool can_convert_geom(const Field_geom *field,
                                         const Column_definition &new_type) const
          {
            return false;
          }
          {code}
          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.
          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:
          {code:cpp}
           virtual bool can_convert_geom(const Field_geom *field,
                                         const Column_definition &new_type) const
          {
            return false;
          }
          {code}
          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.
          bar Alexander Barkov made changes -
          issue.field.resolutiondate 2019-07-10 00:43:59.0 2019-07-10 00:43:59.844
          bar Alexander Barkov made changes -
          Fix Version/s 10.5.0 [ 23709 ]
          Fix Version/s 10.5 [ 23123 ]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 98115 ] MariaDB v4 [ 134036 ]

          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.