pingcap/tidb

Error should be thrown when there's ASC/DESC with GROUP BY clause

Open

#10.522 aberto em 17 de mai. de 2019

Ver no GitHub
 (8 comments) (0 reactions) (1 assignee)Go (6.186 forks)batch import
help wantedpriority/P4sig/plannertype/feature-request

Métricas do repositório

Stars
 (40.090 stars)
Métricas de merge de PR
 (Mesclagem média 14d 4h) (346 fundiu PRs em 30d)

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a recipe for reproducing the error.
CREATE TABLE t1 (id INTEGER, sex CHAR(1));
SELECT sex, AVG(id), ROW_NUMBER() OVER w FROM t1
GROUP BY sex ASC
WINDOW w AS () ORDER BY sex DESC;
  1. What did you expect to see?

Error ASC or DESC with GROUP BY isn't allowed with window functions; put ASC or DESC in ORDER BY is thrown.

  1. What did you see instead?

Execute successfully with no warning.

  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?

Guia do colaborador