[MDEV-10881] cte_recursive test fails with ps-protocol Created: 2016-09-24  Updated: 2016-09-26  Resolved: 2016-09-26

Status: Closed
Project: MariaDB Server
Component/s: Optimizer - CTE, Tests
Affects Version/s: 10.2
Fix Version/s: 10.2.2

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Igor Babaev
Resolution: Fixed Votes: 0
Labels: None


 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;



 Comments   
Comment by Igor Babaev [ 2016-09-24 ]

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.

Comment by Igor Babaev [ 2016-09-26 ]

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

Generated at Thu Feb 08 07:45:38 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.