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

Fix ORDER BY syntax #499

Closed
zier-one opened this issue Aug 19, 2019 · 3 comments
Closed

Fix ORDER BY syntax #499

zier-one opened this issue Aug 19, 2019 · 3 comments

Comments

@zier-one
Copy link
Contributor

Index Issue: pingcap/tidb#11486

These are bad (incompatible) SQL cases:

ALTER TABLE t_n ORDER BY ident

Claim this subtask based on the comments below this issue.

@zuoRambo
Copy link
Contributor

Let me fix it

@zuoRambo
Copy link
Contributor

I have some confusions.

  1. In Mysql 8.0 Alter Table Doc: Alter Table Syntax is | ORDER BY col_name [, col_name] ..., which means it just need col_name after order by.
    image

  2. But in Mysql yacc file Order by statement in ALTER TABLE . It has opt_ordering_direction(ASC|DESC).
    image

So i think there must something wrong.
image

@kennytm
Copy link
Contributor

kennytm commented Aug 27, 2019

The doc is not always complete. Let's also support the ordering direction.

ALTER TABLE t ORDER BY a ASC, b DESC, c;

@zier-one zier-one closed this as completed Sep 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants