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

Derived tables allow double LIMIT clause

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0(EOL), 10.1(EOL), 10.2(EOL)
    • 10.2.1
    • Parser
    • None
    • 10.2.1-2, 10.2.1-3

    Description

      This script:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a INT);
      INSERT INTO t1 VALUES (1),(2),(3);
      SELECT * FROM  (SELECT * FROM t1 LIMIT 1 LIMIT 2) t1;
      

      returns

      +------+
      | a    |
      +------+
      |    1 |
      |    2 |
      +------+
      

      Notice, there are two LIMIT clauses, and the first LIMIT clause is obviously ignored.

      It should return a syntax error.

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              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.