[MDEV-28867] "With recursive" clause buggy or 1001 rows limited Created: 2022-06-16  Updated: 2022-06-16  Resolved: 2022-06-16

Status: Closed
Project: MariaDB Server
Component/s: Data Manipulation - Subquery
Affects Version/s: 10.6.8
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Albert Hastings Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

https://hub.docker.com/_/mariadb (docker pull mariadb:10.6.8-focal)
Ubuntu 20.04.4 LTS (Focal Fossa)



 Description   

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.6.8-MariaDB-1:10.6.8+maria~focal mariadb.org binary distribution
 
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]> with
    ->    recursive Table1 as (
    ->       select
    ->          1 as id
    ->       union all
    ->       select
    ->          A.id + 1 as id
    ->       from
    ->          Table1 A
    ->       where
    ->          A.id < 155
    ->    )
    -> select
    ->     count(*)
    -> from
    ->     Table1;
+----------+
| count(*) |
+----------+
|      155 |
+----------+
1 row in set (0.000 sec)
 
MariaDB [(none)]> with
    ->    recursive Table1 as (
    ->       select
    ->          1 as id
    ->       union all
    ->       select
    ->          A.id + 1 as id
    ->       from
    ->          Table1 A
    ->       where
    ->          A.id < 40000
    ->    )
    -> select
    ->     count(*)
    -> from
    ->     Table1;
+----------+
| count(*) |
+----------+
|     1001 |
+----------+
1 row in set (0.002 sec)
 
MariaDB [(none)]> 



 Comments   
Comment by Daniel Black [ 2022-06-16 ]

1000 is the default limit.

Comment by Albert Hastings [ 2022-06-16 ]

,
https://mariadb.com/kb/en/server-system-variables/#max_recursive_iterations

Generated at Thu Feb 08 10:04:04 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.