You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Alice Chen (JIRA)" <ji...@apache.org> on 2015/07/22 20:14:21 UTC

[jira] [Created] (TRAFODION-137) LP Bug: 1246177 - ORDER BY DESC should be applied before LIMIT

Alice Chen created TRAFODION-137:
------------------------------------

             Summary: LP Bug: 1246177 - ORDER BY DESC should be applied before LIMIT
                 Key: TRAFODION-137
                 URL: https://issues.apache.org/jira/browse/TRAFODION-137
             Project: Apache Trafodion
          Issue Type: Bug
          Components: sql-general
            Reporter: Weishiun Tsai
            Assignee: Anoop Sharma
            Priority: Critical


When using ORDER BY DESC and LIMIT together, ORDER BY DESC should be applied before LIMIT, but the current implementation seems to have it the other way around.  In the following example, 10, 9 were expected, but 2, 1 were returned instead.

>>set schema seabase.mytest;

>>create table t (a int not null not droppable primary key);

--- SQL operation complete.
>>insert into t values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);

--- 10 row(s) inserted.
>>select * from t order by a desc limit 2;

A
-----------

          2
          1

--- 2 row(s) selected.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)