You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/12/16 22:49:00 UTC

[jira] [Commented] (ASTERIXDB-3000) Incorrect query result in SQL-compat mode

    [ https://issues.apache.org/jira/browse/ASTERIXDB-3000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17461107#comment-17461107 ] 

ASF subversion and git services commented on ASTERIXDB-3000:
------------------------------------------------------------

Commit 311d6f7dd3a4e1273dbd615cc7b19f23232f6d84 in asterixdb's branch refs/heads/master from Dmitry Lychagin
[ https://gitbox.apache.org/repos/asf?p=asterixdb.git;h=311d6f7 ]

[ASTERIXDB-3000] Incorrect result in SQL-compat mode

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Fix incorrect subquery coercion rewriting in SQL-compat
  mode if the subquery has an ORDER BY clause
- Add tests

Change-Id: Ia852f20864c2098221011dee4f2c738a52dc8368
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/14543
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Dmitry Lychagin <dm...@couchbase.com>
Reviewed-by: Ali Alsuliman <al...@gmail.com>


> Incorrect query result in SQL-compat mode
> -----------------------------------------
>
>                 Key: ASTERIXDB-3000
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-3000
>             Project: Apache AsterixDB
>          Issue Type: Bug
>          Components: COMP - Compiler
>    Affects Versions: 0.9.7
>            Reporter: Dmitry Lychagin
>            Assignee: Dmitry Lychagin
>            Priority: Major
>             Fix For: 0.9.7
>
>
> The following query returns wrong result in SQL-compat mode.
> {noformat}
> // requesttype=application/json
> // param sql-compat:json=true
> select r1
> from range(1, 5) r1
> where r1 IN (select r2 as r3 from range(1, 5) r2 order by r3 desc limit 2)
> order by r1;
> {noformat}
> It returns 
> {noformat}
> { "r1": 1 }
> { "r1": 2 }
> {noformat}
> While the correct result is:
> {noformat}
> { "r1": 4 }
> { "r1": 5 }
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)