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

Replace {STRING|INT|REAL|DECIMAL|DATE}_ITEM to CONST_ITEM

    XMLWordPrintable

Details

    Description

      The enumeration Item::Type has data-type specific constants for literals:

      • STRING_ITEM
      • INT_ITEM
      • REAL_ITEM
      • DECIMAL_ITEM
      • DATE_ITEM

      This is not friendly to upcoming data type plugins, as they'll need to create their own literals.

      We'll do the following:

      • Remove the data type specific enumeration values from Item::Type
      • Add a new value CONST_ITEM
      • Fix the calling code to test for CONST_ITEM, and when it is necessary, detect the data type using other means, such as type_handler(), or by adding new virtual methods into Item or its descendants.

      Note, under terms of this task, we'll preserve the old behavior. For example, Item_param::type() (when assigned to an integer value), reports itself as INT_ITEM. This makes parameter work as a position rather than an expression when used in ORDER BY:

        if (order_item->type() == Item::INT_ITEM && order_item->basic_const_item() &&
            !from_window_spec)
      

      This behavior was most likely introduced as a side effect. The new implementation will preserve the old behavior, including side effects like this.

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.