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

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

    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

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

                Dates

                • Created:
                  Updated:
                  Resolved: