Bug #98881 CTE manpage doesn't mention SET_VAR
Submitted: 9 Mar 15:43 Modified: 13 Mar 13:59
Reporter: Saverio Miroddi Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Documentation Severity:S4 (Feature request)
Version:8.0.x OS:Any
Assigned to: CPU Architecture:Any

[9 Mar 15:43] Saverio Miroddi
The (thorough) CTE manpage (https://dev.mysql.com/doc/refman/8.0/en/with.html) mentions different ways to limit the recursion.

Given that the main example of recursion if essentially a sequence generator, I think it's a missed opportunity not to mention `SET_VAR` as limitation mean, for a couple of reasons:

1. it's a cool, shiny, new MySQL 8.0 feature, which is also not very well-known;
2. it fits better than using time as limitation parameter for a sequence generator (in particular, the default of 1000 may be tight for this)

My suggestion is to add a reference to it (not to replace the existing approaches).

How to repeat:
See https://dev.mysql.com/doc/refman/8.0/en/with.html#common-table-expressions-recursive-examp....
[9 Mar 15:44] Saverio Miroddi
Sorry, I missed the parameter name: i refer to the recursion depth, e.g.:

    /*+ SET_VAR(cte_max_recursion_depth = 1M) */
[11 Mar 7:17] MySQL Verification Team
Hello Saverio M,

Thank you for the doc request!

[13 Mar 13:59] Paul Dubois
Posted by developer:
Thanks for the suggestion.