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

cte_recursive test fails with ps-protocol

Details

    Description

      perl ./mtr main.cte_recursive --ps-protocol
      

      main.cte_recursive                       [ fail ]
              Test ended at 2016-09-24 17:14:40
       
      CURRENT_TEST: main.cte_recursive
      mysqltest: At line 1165: query 'create table my_ancestors
      with recursive
      ancestor_ids (id)
      as
      (
      select father from folks where name = 'Me'
        union
      select mother from folks where name = 'Me'
        union
      select father from folks, ancestor_ids a  where folks.id = a.id
      union
      select mother from folks, ancestor_ids a  where folks.id = a.id
      )
      select p.* from folks as p, ancestor_ids as a where p.id = a.id' failed: 1146: Table 'test.ancestor_ids' doesn't exist
       
      The result from queries just before the failure was:
      < snip >
                }
              }
            }
          }
        }
      }
      create table my_ancestors
      with recursive
      ancestor_ids (id)
      as
      (
      select father from folks where name = 'Me'
        union
      select mother from folks where name = 'Me'
        union
      select father from folks, ancestor_ids a  where folks.id = a.id
      union
      select mother from folks, ancestor_ids a  where folks.id = a.id
      )
      select p.* from folks as p, ancestor_ids as a where p.id = a.id;
      
      

      Attachments

        Activity

          igor Igor Babaev (Inactive) added a comment - - edited

          The following also fails:

          prepare stmt from "
          with recursive
          ancestor_ids (id)
          as
           (
              select father from folks where name = 'Me'
              union
              select mother from folks where name = 'Me'
              union
              select father from folks, ancestor_ids a  where folks.id = a.id
              union
              select mother from folks, ancestor_ids a  where folks.id = a.id
           )
           select p.* from folks as p, ancestor_ids as a where p.id = a.id;
            ";
          execute stmt;
           
          MariaDB [test]> prepare stmt from "
              "> with recursive
              "> ancestor_ids (id)
              "> as
              ">  (
              ">     select father from folks where name = 'Me'
              ">     union
              ">     select mother from folks where name = 'Me'
              ">     union
              ">     select father from folks, ancestor_ids a  where folks.id = a.id
              ">     union
              ">     select mother from folks, ancestor_ids a  where folks.id = a.id
              ">  )
              ">  select p.* from folks as p, ancestor_ids as a where p.id = a.id;
              ">   ";
          Query OK, 0 rows affected (6.91 sec)
          Statement prepared
           
          MariaDB [test]> execute stmt;
          ERROR 1054 (42S22): Unknown column 'a.id' in 'where clause'
          

          The cause of the above failure is different and I opened a new bug for it: mdev-10883.
          This bug will be fixed first, as the fix for mdev-10881 won't work without it.

          igor Igor Babaev (Inactive) added a comment - - edited The following also fails: prepare stmt from " with recursive ancestor_ids (id) as ( select father from folks where name = 'Me' union select mother from folks where name = 'Me' union select father from folks, ancestor_ids a where folks.id = a.id union select mother from folks, ancestor_ids a where folks.id = a.id ) select p.* from folks as p, ancestor_ids as a where p.id = a.id; "; execute stmt;   MariaDB [test]> prepare stmt from " "> with recursive "> ancestor_ids (id) "> as "> ( "> select father from folks where name = 'Me' "> union "> select mother from folks where name = 'Me' "> union "> select father from folks, ancestor_ids a where folks.id = a.id "> union "> select mother from folks, ancestor_ids a where folks.id = a.id "> ) "> select p.* from folks as p, ancestor_ids as a where p.id = a.id; "> "; Query OK, 0 rows affected (6.91 sec) Statement prepared   MariaDB [test]> execute stmt; ERROR 1054 (42S22): Unknown column 'a.id' in 'where clause' The cause of the above failure is different and I opened a new bug for it: mdev-10883. This bug will be fixed first, as the fix for mdev-10881 won't work without it.

          The fix for this bug was pushed into the 10.2 tree.

          igor Igor Babaev (Inactive) added a comment - The fix for this bug was pushed into the 10.2 tree.

          People

            igor Igor Babaev (Inactive)
            elenst Elena Stepanova
            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.