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

LIMIT variable and subselect failure

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • 11.4.2
    • N/A
    • Parser
    • None
    • Windows 10 x64 22H2 (because I like a working computer)
    • Not for Release Notes

    Description

      This fails to work:

      SET @`x` = 20;
      SELECT * FROM messages LIMIT @`x`;

      Which is the basis for:

      SET @`x` = (SELECT pagination_limit FROM options WHERE user='John');
      SELECT * FROM messages LIMIT @`x`;

      Which should also translate to:

      SELECT * FROM messages LIMIT (SELECT 20);

      Which in turn would translate to:

      SELECT * FROM messages LIMIT (SELECT pagination_limit FROM options WHERE user='John');

      The goal for my users is to simply allow them to set their returned results by controlling the LIMIT. My goal is to not have to write crazy complex things to accomplish simple goals.

      I did some searching through I couldn't find any relevant bug reports. MariaDB does almost everything I need amazingly well so please forgive me if I missed anything filing this bug report.

      Attachments

        Activity

          People

            Unassigned Unassigned
            JAB Creations John Bilicki
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.