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

about “show create table” bug #24237

Closed
pipahuadi opened this issue May 26, 2023 · 1 comment · Fixed by #24257
Closed

about “show create table” bug #24237

pipahuadi opened this issue May 26, 2023 · 1 comment · Fixed by #24257
Labels
type/bug Something isn't working

Comments

@pipahuadi
Copy link

Steps to reproduce the behavior (Required)

  1. create table test_db.test
    ( id int(9),
    create_time datetime NOT NULL DEFAULT current_timestamp )
    ENGINE=OLAP
    PRIMARY KEY (id)
    DISTRIBUTED BY HASH(id) BUCKETS 5

  2. show create table test_db.test

  3. result : CREATE TABLE test ( id int(11) NOT NULL COMMENT "", create_time datetime NOT NULL COMMENT "" ) ENGINE=OLAP PRIMARY KEY(id) COMMENT "OLAP" DISTRIBUTED BY HASH(id) BUCKETS 5 PROPERTIES ( "replication_num" = "3", "in_memory" = "false", "storage_format" = "DEFAULT" );

4.create table test_db.test
( id int(9),
create_time datetime NOT NULL DEFAULT current_timestamp )
ENGINE=OLAP
DISTRIBUTED BY HASH(id) BUCKETS 5

5.show create table test_db.test

6.result :CREATE TABLE test ( id int(11) NULL COMMENT "", create_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT "" ) ENGINE=OLAP DUPLICATE KEY(id, create_time) COMMENT "OLAP" DISTRIBUTED BY HASH(id) BUCKETS 10 PROPERTIES ( "replication_num" = "3", "in_memory" = "false", "storage_format" = "DEFAULT" );

Expected behavior (Required)

This happens only when PRIMARY KEY is used, and it does not happen when using UNIQUE KEY, DUPLICATE KEY or not using PRIMARY KEY,it should be fixed

Real behavior (Required)

image

StarRocks version (Required)

starrocks-2.4.3、
starrocks-2.2.2

@pipahuadi pipahuadi added the type/bug Something isn't working label May 26, 2023
Astralidea added a commit that referenced this issue May 29, 2023
mergify bot pushed a commit that referenced this issue May 29, 2023
…#24257)

Fixes #24237

Signed-off-by: Astralidea <astralidea@163.com>
(cherry picked from commit 6fc5ca3)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/catalog/Column.java
mergify bot pushed a commit that referenced this issue May 29, 2023
…#24257)

Fixes #24237

Signed-off-by: Astralidea <astralidea@163.com>
(cherry picked from commit 6fc5ca3)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/catalog/Column.java
mergify bot pushed a commit that referenced this issue May 29, 2023
…#24257)

Fixes #24237

Signed-off-by: Astralidea <astralidea@163.com>
(cherry picked from commit 6fc5ca3)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/catalog/Column.java
#	fe/fe-core/src/test/java/com/starrocks/analysis/ShowCreateTableStmtTest.java
@Astralidea
Copy link
Contributor

This problem will only be fixed to version 2.5 and later, the previous version will not be maintained because it is not LTS

abc982627271 pushed a commit to abc982627271/starrocks that referenced this issue Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants