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

Split resolve_const_item() into virtual methods in Type_handler

    XMLWordPrintable

Details

    Description

      resolve_const_item() is not friendly to pluggable data types, as it has:

      • A switch on the result of item_cmp_type()
      • A call for field_type_for_temporal_comparison()

      This is hard-coded for built-in data types only and won't work properly for new data types.

      We'll do the following:

      • Introduce a new method in Type_handler:

        virtual Item *make_const_item_for_comparison(THD *thd,
                                                     Item *src,
                                                     Item *comparand) const= 0;
        

      • Split the code in resolve_const_item() into virtual implementations of the proper type handler implementations
      • Replace item_cmp_type() to Type_handler_hybrid_field_type::aggregate_for_comparison()
      • Remove Item::field_type_for_temporal_comparison(), as it won't be used any more in the server code.

      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:

                Git Integration

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