Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-29477

recursive query silently discards result after an arbitrary (?) threshold

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.6.8
    • N/A
    • Optimizer - CTE
    • 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.

      Attachments

        Activity

          People

            serg Sergei Golubchik
            doublep Paul Pogonyshev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.