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

incorrect nest_level value with INTERSECT

    XMLWordPrintable

    Details

      Description

      If put such assert which shoud be true several tests in the test suite which use INTERSECT will fail:

      diff --git a/sql/sql_base.cc b/sql/sql_base.cc
      index 2b06cf27d9b..93ed007300a 100644
      --- a/sql/sql_base.cc
      +++ b/sql/sql_base.cc
      @@ -7503,6 +7503,10 @@ bool setup_fields(THD *thd, Ref_ptr_array ref_pointer_array,
       
         thd->column_usage= column_usage;
         DBUG_PRINT("info", ("thd->column_usage: %d", thd->column_usage));
      +  DBUG_ASSERT(thd->lex->current_select->nest_level >= 0);
      +  DBUG_ASSERT(thd->lex->current_select->master_unit()->first_select()
      +                ->nest_level ==
      +              thd->lex->current_select->nest_level);
         if (allow_sum_func)
           thd->lex->allow_sum_func.set_bit(thd->lex->current_select->nest_level);
         thd->where= THD::DEFAULT_WHERE;
      

        Attachments

          Activity

            People

            Assignee:
            sanja Oleksandr Byelkin
            Reporter:
            sanja Oleksandr Byelkin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration