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

Identifier quoting #49

Open
Halama opened this issue Nov 29, 2018 · 9 comments
Open

Identifier quoting #49

Halama opened this issue Nov 29, 2018 · 9 comments
Assignees

Comments

@Halama
Copy link
Member

Halama commented Nov 29, 2018

Dvojitou uvozovku v identifikátoru quotujeme jejích zdvojením.
Snowflake si s tím ale ani tak neporadí. Zatím není jasné jestli to je feature. Ticket na SNFLK https://support.snowflake.net/s/case/5000Z000013XHyLQAW/quote-character

Pokud ji nepodporuje tak bysme myslím měly vyhazovat error při zadání takového objektu.

@Halama Halama added this to the snowflake-connection milestone Nov 29, 2018
@ErikZigo ErikZigo self-assigned this Nov 29, 2018
@Halama
Copy link
Member Author

Halama commented Dec 6, 2018

Hi Ondra,
Do you want us to keep this case opened for now or shall we proceed to close it? I presume we have concluded that injecting double quotes in object identifiers isn't possible.
Regards,
Jawwad

Takže idenitifkátor uvozovku obsahovat nemůže. Tím pádem by to zdvojení uvozovky v quoteIdentifier mělo být zbytečný.

Naopak bysme měli vyhazovat exception v případě že bude předán indentifikátor s uvozovkou?

@ondrejhlavacek
Copy link
Member

Doplním, že IDENTIFIER nepobere ani jednoduchou ani dvojitou.

INSERT INTO IDENTIFIER('my''table') VALUES (...);
SQL compilation error: error line 1 at position 23 invalid identifier ''my''table''
(two single quotes)

INSERT INTO IDENTIFIER('my"table') VALUES (...);
SQL compilation error: error line 1 at position 23 invalid identifier ''my"table''
(double quote)

Obyčejný uzavření identifikátoru do uvozovek umožní jednoduchou uvozovku, dvojitou ne.

INSERT INTO "my'table" VALUES (...);

@Halama
Copy link
Member Author

Halama commented Dec 6, 2018

Ten identifier musíš používat takhle:

INSERT INTO IDENTIFIER("my'table") VALUES (...);

@Halama
Copy link
Member Author

Halama commented Dec 6, 2018

a pobere to tedy vše kromě dvojíté uvozovky.

INSERT INTO IDENTIFIER("💩💩💩💩") VALUES (...);

@ondrejhlavacek
Copy link
Member

Dvojitý uvozovky do IDENTIFIER? Podle dokumentace bych to nečekal

https://docs.snowflake.net/manuals/sql-reference/identifier-literal.html

@ondrejhlavacek
Copy link
Member

SELECT * FROM IDENTIFIER("test'test");
SQL compilation error: syntax error line 1 at position 25 unexpected '"test'test"'.

@Halama
Copy link
Member Author

Halama commented Dec 6, 2018

omg, sorry nevyzkoušel jsem si to předtím a překlepl se:

create table IDENTIFIER('"my\'table"') (id varchar);

image

@Halama
Copy link
Member Author

Halama commented Dec 6, 2018

@Halama
Copy link
Member Author

Halama commented Dec 6, 2018

-- case-sensitive table name specified in a double-quoted string
create or replace table identifier('"my_table"') (c1 number);

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

No branches or pull requests

3 participants