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

Wrong result when using IN subquery with order by

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.5.37, 10.0.11
    • 5.5.38, 10.0.12
    • None
    • None
    • Ubuntu Precise, also Ubuntu 14.04

    Description

      I got a wrong result in two different machines

      I tried after uploading the prueba.sql file the following query:

      SELECT * FROM agentes WHERE id in (select distinct id_agente from otra) ORDER BY nombre ASC;

      I get:

      +----+--------+
      | id | nombre |
      +----+--------+
      |  1 | row 1  |
      |  1 | row 1  |
      |  1 | row 1  |
      |  2 | row 2  |
      |  2 | row 2  |
      |  3 | row 3  |
      +----+--------+

      but if I remove the order by clause I get:

      +----+--------+
      | id | nombre |
      +----+--------+
      |  1 | row 1  |
      |  2 | row 2  |
      |  3 | row 3  |
      +----+--------+

      I don't put much more information i think it's very reproductible since i got it in two different machines.

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            satonio jose antonio
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.