Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2(EOL)
-
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;
|
|
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.