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

find_order_in_list mismatch when order item needs fixing()

Details

    Description

      If we add a reasonable assert here in find_order_in_list()

      │B+> 27158     if (resolution == RESOLVED_BEHIND_ALIAS &&
      │    27159         order_item->fix_fields_if_needed_for_order_by(thd, order->item)) 
      │    27160       return TRUE; 
      │    27161
      │    27162     /* Lookup the current GROUP field in the FROM clause. */ 
      │    27163     order_item_type= order_item->type(); 
      │    27164     DBUG_ASSERT( order_item_type == (*order->item)->type() );       
      

      the assert fails executing

      CREATE TABLE t2 ( a INT ); 
      INSERT INTO t2 VALUES (1),(2),(1),(4),(2);
      SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a;
      

      Analysis to follow in comments

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Rex Johnston made transition -
            Open Closed
            2d 1h 43m 1

            People

              Johnston Rex Johnston
              Johnston Rex Johnston
              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.