I was inspired by this tutorial for SQLite to try the same thing for MariaDB - skip ahead to the "Outlandish Recursive Query Examples" section:
So I re-wrote the query slightly, just changing the min function to be least so it will run in MariaDB:
The query seems to run forever without completing.
I've also tested the query with the most recent MySQL version - 8.0.19, just changing the VALUES to VALUES ROW and setting @@cte_max_recursion_depth to a big number in the query above. The query doesn't seem to complete there either.