Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: disallow different orders in ORDER BY clause #4038

Closed
Korablev77 opened this issue Mar 11, 2019 · 2 comments
Closed

sql: disallow different orders in ORDER BY clause #4038

Korablev77 opened this issue Mar 11, 2019 · 2 comments
Assignees
Labels
bug Something isn't working sql
Milestone

Comments

@Korablev77
Copy link
Contributor

Korablev77 commented Mar 11, 2019

Without multi-directional iterators (to be introduced in #3309) in most cases (except those when internal VDBE merge sorter is used) ORDER BY with different specified ordered leads to wrong result. For instance:

CREATE TABLE t (id INT PRIMARY KEY, a INT, b INT);
INSERT INTO t VALUES (1, 2, 1), (2, -3, 5), (3, 2, -3), (4, 2, 12);
SELECT * FROM t ORDER BY a ASC, b DESC LIMIT 5;
---
- - [2, -3, 5]
  - [3, 2, -3]
  - [1, 2, 1]
  - [4, 2, 12]
...

One can see that results are sorted by 'a' field, but not by 'b'. So lets temporary (util #3309 is resolved) disable this feature.

@Korablev77 Korablev77 added bug Something isn't working sql labels Mar 11, 2019
@SudoBobo SudoBobo self-assigned this Mar 11, 2019
@kyukhin kyukhin added this to the 2.1.2 milestone Mar 11, 2019
@pgulutzan
Copy link
Contributor

The results in that example look correct to me. What results were expected?

@Korablev77
Copy link
Contributor Author

Oh, sorry, I've slightly modified example (forgot to add LIMIT clause).

SudoBobo added a commit that referenced this issue Mar 11, 2019
Without multi-directional iterators (to be introduced in #3309)
in most cases (except those when internal VDBE merge sorter is
used) ORDER BY with different specified ordered leads to wrong
result. So for now (till #3309 is resolved) different sort
orders are forbidden.

Close #4038

@TarantoolBot document
Title: different sorting orders in ORDER BY are forbidden now
The error will be raised if different sorting orders are
encountered.
SudoBobo added a commit that referenced this issue Mar 11, 2019
Without multi-directional iterators (to be introduced in #3309)
in most cases (except those when internal VDBE merge sorter is
used) ORDER BY with different specified ordered leads to wrong
result. So for now (till #3309 is resolved) different sort
orders are forbidden.

Close #4038

@TarantoolBot document
Title: different sorting orders in ORDER BY are forbidden now
The error will be raised if different sorting orders are
encountered.
SudoBobo added a commit that referenced this issue Mar 15, 2019
Without multi-directional iterators (to be introduced in #3309)
ORDER BY + LIMIT with different specified ordered leads to wrong
result. So for now (till #3309 is resolved) different sort
orders are forbidden in ORDER BY + LIMIT.

Close #4038

@TarantoolBot document
Title: different sorting orders in ORDER BY are forbidden now
The error will be raised if different sorting orders are
encountered.
SudoBobo added a commit that referenced this issue Mar 15, 2019
Without multi-directional iterators (to be introduced in #3309)
ORDER BY + LIMIT with different specified ordered leads to wrong
result. So for now (till #3309 is resolved) different sort
orders are forbidden in ORDER BY + LIMIT.

Close #4038

@TarantoolBot document
Title: different sorting orders in ORDER BY are forbidden now
The error will be raised if different sorting orders are
encountered.
SudoBobo added a commit that referenced this issue Mar 15, 2019
Without multi-directional iterators (to be introduced in #3309)
ORDER BY + LIMIT with different specified ordered leads to wrong
result. So for now (till #3309 is resolved) different sort
orders are forbidden in ORDER BY + LIMIT.

Close #4038

@TarantoolBot document
Title: different sorting orders in ORDER BY are forbidden now
The error will be raised if different sorting orders are
encountered.
SudoBobo added a commit that referenced this issue Mar 15, 2019
Without multi-directional iterators (to be introduced in #3309)
ORDER BY + LIMIT with different specified ordered leads to wrong
result. So for now (till #3309 is resolved) different sort
orders are forbidden in ORDER BY + LIMIT.

Close #4038

@TarantoolBot document
Title: different sorting orders in ORDER BY are forbidden now
The error will be raised if different sorting orders are
encountered.
SudoBobo added a commit that referenced this issue Mar 18, 2019
Without multi-directional iterators (to be introduced in #3309)
ORDER BY + LIMIT with different specified ordered leads to wrong
result. So for now (till #3309 is resolved) different sort
orders are forbidden in ORDER BY + LIMIT.

Close #4038

@TarantoolBot document
Title: different sorting orders in ORDER BY are forbidden now
The error will be raised if different sorting orders are
encountered.
@kyukhin kyukhin added the tmp label Mar 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sql
Projects
None yet
Development

No branches or pull requests

4 participants