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

auto_random metaphors the column be PK but has no way to be clustered #23235

Open
lysu opened this issue Mar 10, 2021 · 3 comments
Open

auto_random metaphors the column be PK but has no way to be clustered #23235

lysu opened this issue Mar 10, 2021 · 3 comments
Assignees
Labels
sig/transaction SIG:Transaction type/enhancement The issue or PR belongs to an enhancement.

Comments

@lysu
Copy link
Contributor

lysu commented Mar 10, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t(a bigint key auto_random(5));

2. What did you expect to see? (Required)

create table t that a be clustered primary key

3. What did you see instead (Required)

ERROR 8216 (HY000): Invalid auto random: column a is not the integer primary key, or table is created with alter-primary-key enabled

4. What is your TiDB version? (Required)

master

@lysu lysu added the type/bug The issue is confirmed as a bug. label Mar 10, 2021
@lysu lysu changed the title auto_random metaphors the column be primary key but cannot be clustered auto_random metaphors the column be PK but has no way to be clustered Mar 10, 2021
@lysu
Copy link
Contributor Author

lysu commented Mar 10, 2021

user can work around by change ddl to

create table t(a bigint key primary key clustered auto_random(5));

it's low priority to fix this, just mark

@lilinghai lilinghai added the sig/sql-infra SIG: SQL Infra label Mar 11, 2021
@tangenta
Copy link
Contributor

So the expected behavior is that auto_random implies clustered?

@tangenta tangenta self-assigned this Mar 12, 2021
@jebter jebter added sig/transaction SIG:Transaction and removed sig/sql-infra SIG: SQL Infra labels Mar 12, 2021
@lysu
Copy link
Contributor Author

lysu commented Mar 18, 2021

So the expected behavior is that auto_random implies clustered?

@bb7133 @coocood how do you think about this?

@jebter jebter added this to the v5.0.0 ga milestone Mar 21, 2021
@zimulala zimulala removed this from the v5.0.0 ga milestone Mar 23, 2021
@tangenta tangenta added type/enhancement The issue or PR belongs to an enhancement. and removed type/bug The issue is confirmed as a bug. severity/minor labels Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/transaction SIG:Transaction type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

5 participants