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

Split Item::send() into virtual method in Type_handler

    XMLWordPrintable

Details

    Description

      Item::send has a switch on field_type():

      bool Item::send(Protocol *protocol, String *buffer)
      {
        ...
        switch ((f_type=field_type())) {
        default:
        case MYSQL_TYPE_NULL:
        case MYSQL_TYPE_DECIMAL:
        ...
      };
      

      This is not friendly to pluggable data types.

      We'll introduce a new in Type_handler instead:

      virtual bool Item_send(Item *item, Protocol *p, st_value *buf) const= 0;
      

      The default implementation of Item::send will look like:

      virtual bool send(Protocol *protocol, st_value *buffer)
      {
        return type_handler()->Item_send(this, protocol, buffer);
      }
      

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0.75d
                  0.75d
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 0.75d
                  0.75d

                  Git Integration

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