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

Create table with a keyword(without quote) returns unknown message #3205

Open
WenyXu opened this issue Jan 20, 2024 · 2 comments
Open

Create table with a keyword(without quote) returns unknown message #3205

WenyXu opened this issue Jan 20, 2024 · 2 comments
Labels
C-bug Category Bugs O-fuzz Found by fuzz tests

Comments

@WenyXu
Copy link
Member

WenyXu commented Jan 20, 2024

What type of bug is this?

User Experience

What subsystems are affected?

Table Engine

Minimal reproduce step

It only happened in pg protocol.

CREATE TABLE "QUo"(
"rEpELLAT" TIMESTAMP(3) TIME INDEX,
minus FLOAT NOT NULL,
"SAEPe" BOOLEAN DEFAULT false,
"culPa" INT NULL,
"SUSCipit" FLOAT NOT NULL,
quibusdam BIGINT NOT NULL,
at INT,
"Non" INT NOT NULL,
"lABORE" FLOAT NULL,
PRIMARY KEY(at)
)
ENGINE=mito

What did you expect to see?

{ severity: Error, code: "XX000", message: "", detail: None, hint: None, position: None, where: None, schema: None, table: None, column: None, data_type: None, constraint: None, file: None, line: None, routine: None }

What did you see instead?

Returns some hint to users

What operating system did you use?

doesn't matter

What version of GreptimeDB did you use?

0.6.0

Relevant log output and stack trace

No response

@WenyXu WenyXu added C-bug Category Bugs O-fuzz Found by fuzz tests labels Jan 20, 2024
@v0y4g3r
Copy link
Contributor

v0y4g3r commented Jan 21, 2024

Escaping at column will do the trick:

CREATE TABLE "QUo"(
"rEpELLAT" TIMESTAMP(3) TIME INDEX,
minus FLOAT NOT NULL,
"SAEPe" BOOLEAN DEFAULT false,
"culPa" INT NULL,
"SUSCipit" FLOAT NOT NULL,
"quibusdam" BIGINT NOT NULL,
"at" INT,
"Non" INT NOT NULL,
"lABORE" FLOAT NULL,
PRIMARY KEY("at")
)
ENGINE=mito;

AT is a keyword in SQL.

@WenyXu
Copy link
Member Author

WenyXu commented Jan 21, 2024

Escaping at column will do the trick:

CREATE TABLE "QUo"(
"rEpELLAT" TIMESTAMP(3) TIME INDEX,
minus FLOAT NOT NULL,
"SAEPe" BOOLEAN DEFAULT false,
"culPa" INT NULL,
"SUSCipit" FLOAT NOT NULL,
"quibusdam" BIGINT NOT NULL,
"at" INT,
"Non" INT NOT NULL,
"lABORE" FLOAT NULL,
PRIMARY KEY("at")
)
ENGINE=mito;

AT is a keyword in SQL.

Yes, the problem here is that error message is missing.🥺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category Bugs O-fuzz Found by fuzz tests
Projects
None yet
Development

No branches or pull requests

2 participants