MDEV-9864 - Implement recursive common table expressions #182

wants to merge 13 commits into


None yet

7 participants

shagalla commented Jun 9, 2016

Please take this implementation of recursive CTE as a contribution for MariaDB server.

shagalla added some commits May 8, 2016
@shagalla shagalla Initial commit for mdev-9864 containing only test files 93845e1
@shagalla shagalla Initial commit just to make a branch for mdev-9864 e09b1f2
@shagalla shagalla Merge branch '10.2' into 10.2-mdev9864 be1d06c
@shagalla shagalla Merge branch '10.2' into 10.2-mdev9864 5703d26
@shagalla shagalla Main patch for mdev-9864 f516b96
@shagalla shagalla Fixed merge problems to allow mysql-test suite 'main' to pass d0e973a
@shagalla shagalla Made prepared statement, explain and views working with recursuve CTE. d9b332b
@shagalla shagalla Fixed a bug that caused crashes for SHOW CREATE VIEW <view> when <vie…
…w> was recursive. Added a test case to check the fix.
@shagalla shagalla Fixed many problems in the code of With_element::check_unrestricted_r…

Added the check whether there are set functions in the specifications of recursive CTE.
Added the check whether there are recursive references in subqueries.
Introduced boolean system variable 'standards_compliant_cte'. By default it's set to 'on'.
When it's set to 'off' non-standard compliant CTE can be executed.
@shagalla shagalla Changes in test files 0f7fe2a
@shagalla shagalla Fixed the problem of wrong identification of WITH tables defined in W…
…ITH clauses without RECURSIVE.

Added test cases to check the fix.
Fixed the problem of wrong types of recursive tables when the type of anchor part does not coincide with the
type of recursive part.
Prevented usage of marerialization and subquery cache for subqueries with recursive references.
Introduced system variables 'max_recursion_level'.
Added a test case to test usage of this variable.
@shagalla shagalla Merge branch '10.2' of into 10.2 c7c2f8d
@shagalla shagalla Merge branch '10.2' into 10.2-mdev9864 6c6c3af
@igorbabaev igorbabaev was assigned by svoj Jun 14, 2016
@svoj svoj changed the title from 10.2 mdev9864 to MDEV-9864 - Implement recursive common table expressions Jun 14, 2016
svoj commented Jun 14, 2016

Hi Galina,

Thanks for your contribution. JIRA task just for the record:

MCA is on file.



Closing: the code is accepted into branch. It is being finalized there before being pushed into 10.2

@spetrunia spetrunia closed this Jun 28, 2016

why this feature is not included into 10.2.1 alpha?

vuvova commented Aug 30, 2016

Because "it's being finalized before being pushed into 10.2", that is, it wasn't ready when 10.2.1 was released.


In what state is with recursive implementation? in my sql query does not work


Recursive CTEs have been pushed into MariaDB-10.2 tree a few days ago. They will be available in the next MariaDB release in the 10.2 series, 10.2.2.

SvetlanaM commented Sep 9, 2016 edited

Ok, because I have seen that travis build failed in one of the builds, you can check travis status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment