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

Order from subquery lost

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Not a Bug
    • Affects Version/s: 10.4.12, 10.6.4
    • Fix Version/s: N/A
    • Component/s: N/A
    • Labels:
      None
    • Environment:
      CentOS7 x64

      Description

      Test case:

      CREATE TABLE `_article2category` (
      	`category_id` INT
      );
      	
      INSERT INTO `_article2category` (`category_id`) VALUES
      (2), (1);
       
       
      SELECT
      	Sub.category_id
      FROM 
      (
      	SELECT 
      		A2C.category_id
      	FROM 
      		_article2category A2C
      	ORDER BY 
      		A2C.category_id ASC
      ) Sub;
       
      DROP TABLE _article2category;
      

      Expected:
      category_id
      1
      2

      Received:
      category_id
      2
      1

      When add index by category_id works as expected

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            M-A-X M-A-X
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration