mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
With_element::prepare_unreferenced() contains query from recursive CTE which is upper owner of unreferenced CTE itself. Such recursive derived table is resolved into its expression and it tries to resolve fields or any other data from subqueries which are not yet prepared. These subqueries are preparing in upper frames of the same stack after prepare_unreferenced() finishes. That does not happen when recursion happens in referenced CTE because in that case there are links between the derived tables defined by the parser and descending into such recursion descends further into all the dependency queries. No such link exists in unreferenced query therefore it misses its upper dependencies. The fix moves prepare_unreferenced() later after JOIN::prepare() so it has the chance to access all the prepared data. There may be another fix of failing unreferenced queries with error as such kind of queries seem to be not usable.
16 KiB
16 KiB