Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
10.6.8
-
None
-
mysql Ver 15.1 Distrib 10.6.8-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper
Description
To reproduce:
drop sequence if exists xxx; |
create sequence xxx; |
select count(*) from (with recursive t (x) as (select 1 x union all select x + 1 from t where x < 10000) select next value for xxx from t); |
This returns 1001, while 10000 is expected. When replacing 10000 in the 'where' clause with a number not larger than 1001, the result matches expectation.
Usecase: inner query is used to fetch N next numbers from a sequence in one statement. For "smaller" numbers it works without problems.
Displayed behavior is very bad. I suspect there might be some reason and the threshold is configurable somewhere, but the application using the database has no way to know it. Returning too few rows without any errors or even warnings results in a hard-to-understand bug in our application, with practically no way to debug it.