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

Split Arg_comparator::set_compare_func() into virtual methods in Type_handler

    Details

      Description

      There is a code in item_cmpfunc.cc:

      int Arg_comparator::set_compare_func(Item_func_or_sum *item, Item_result type)
      {
        owner= item;
        func= comparator_matrix[type]
                               [is_owner_equal_func()];
       
        switch (type) {
        case TIME_RESULT:
        ..
        case INT_RESULT:
        ..
        case STRING_RESULT:
        ..
        case DECIMAL_RESULT:
        ..
        case REAL_RESULT:
        }
      

      Under terms of this task we'll decompose this switch into a new virtual method in Type_handler:

        virtual bool set_comparator_func(Arg_comparator *cmp) const;
      

      Pieces of the code from every XXX_RESULT in the switch will go to the corresponding Type_handler.
      E.g. the code from STRING_RESULT will go to Type_handler_string_result::set_comparator_func.

        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: