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

Check the class of the copy made by Item::shallow_copy()

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 13.2.1
    • Optimizer
    • None
    • Not for Release Notes
    • Q4/2026 Server Maintenance

    Description

      Item::shallow_copy() was meant to create a copy of the same class as the item it is called on, but nothing enforced that. A class that does not declare its own override inherits the one of its nearest concrete parent, and get_item_copy<Parent>() then silently creates an object of the parent class, losing the child's virtual behaviour (see MDEV-38801 for an earlier instance with Item_cache_year).

      Attachments

        Activity

          People

            Johnston Rex Johnston
            Johnston Rex Johnston
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 1.25d
                1.25d

                Git Integration

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