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

2nd execution outer context crash

    XMLWordPrintable

Details

    Description

      create table t1 (t1a int, t1b int, t1c int) engine=myisam;
      insert into t1 values (1,1,1),(2,2,2);
       
      create table t2 (t2a int, t2b int, t2c int) engine=myisam;
      insert into t2 values (1,1,1),(2,2,2),(3,3,3);
       
      create table t3 (t3a int, t3b int, t3c int) engine=myisam;
      insert into t3 values (1,1,1),(2,2,2),(3,3,3),(4,4,4);
       
      create table t4 (t4a int, t4b int, t4c int) engine=myisam;
      insert into t4 values (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5);
       
      create table t5 (t5a int, t5b int, t5c int) engine=myisam;
      insert into t5 values (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),(6,6,6);
       
      create table t6 (t6a int, t6b int, t6c int) engine=myisam;
      insert into t6 values (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),(6,6,6),(7,7,7);
       
      create table t7 (t7a int, t7b int, t7c int) engine=myisam;
      insert into t7 values (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),(6,6,6),(7,7,7),
      (8,8,8);
       
      create view v2 (v2a, v2b) as
        select t7a*t5c, t7b*t5c from t7, t5 where t7a = t5a and t7c > 4;
      
      

      When executed as a prepared statement, the 2nd execution of this query

      select * from
      (
        select t1a from t1 join v2 on t1c = v2b
         where t1a in
        (
          select t2a from t2
           where t2b >= any
          (
            select t3b from t3
             where t3c >= t1b
             and t3a >= t1c and t3b >= t1a
          )
           and t2b >= v2b
        )) dt;
      

      causes an assert failure in Item_field::fix_outer_field

         DBUG_ASSERT(outer_context || !*from_field ||  
                     *from_field == not_found_field); 
      

      outer_context is null and *from_field == view_ref_found

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:

                Git Integration

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