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

P1-[4.0 bug hunting]-[Sequence]-can not create table when primary key has sequence as default value #11

Open
AndrewDi opened this issue Apr 15, 2020 · 3 comments

Comments

@AndrewDi
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

create sequence seq;
create table test(a bigint not null default nextval(seq),b char(3),primary key (a))

2. What did you expect to see?

create table success

3. What did you see instead?

mysql> create table test(a bigint not null default nextval(seq),b char(3),primary key (a));
ERROR 1171 (42000): All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead

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

master branch

@AilinKid
Copy link

thanks for reporting, Pan.

@ChenPeng2013
Copy link

/bug p1 n

@AndrewDi AndrewDi changed the title P0-[4.0 bug hunting]-[Sequence]-can not create table when primary key has sequence as default value P1-[4.0 bug hunting]-[Sequence]-can not create table when primary key has sequence as default value Apr 15, 2020
@shuke987
Copy link

/bug P1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants