提交 061618f0 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

GENERATED * AS IDENTITY should not create a primary key

上级 5fad0d3b
...@@ -4887,7 +4887,6 @@ public class Parser { ...@@ -4887,7 +4887,6 @@ public class Parser {
} }
read(CLOSE_PAREN); read(CLOSE_PAREN);
} }
column.setPrimaryKey(true);
column.setAutoIncrement(true, start, increment); column.setAutoIncrement(true, start, increment);
} }
if (readIf(ON)) { if (readIf(ON)) {
......
...@@ -95,3 +95,22 @@ SELECT COLUMN_NAME, IS_VISIBLE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME ...@@ -95,3 +95,22 @@ SELECT COLUMN_NAME, IS_VISIBLE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME
DROP TABLE TEST; DROP TABLE TEST;
> ok > ok
CREATE TABLE TEST1(ID IDENTITY);
> ok
CREATE TABLE TEST2(ID BIGINT IDENTITY);
> ok
CREATE TABLE TEST3(ID BIGINT GENERATED BY DEFAULT AS IDENTITY);
> ok
SELECT CONSTRAINT_TYPE, TABLE_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE TABLE_SCHEMA = 'PUBLIC';
> CONSTRAINT_TYPE TABLE_NAME
> --------------- ----------
> PRIMARY KEY TEST1
> PRIMARY KEY TEST2
> rows: 2
DROP TABLE TEST1, TEST2, TEST3;
> ok
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论