Double-click on table cannot parse schema name without quotes
Answered
Hello,
Whenever I use double-click in database toolbar to do the SELECT query, it drives me crazy because it failed to parse query.
"[42000][1001] Failed to parse query. Table "UCP" not found; SQL statement:
SELECT t.* FROM ucp-schema-name.TABLENAME t [42102-197]"
From console it works when I put the quotes around 'ucp-schema-name'
SELECT t.* FROM "ucp-schema-name".TABLENAME t
but the double-click on table generates it without quotes, and it fails to parse.
SELECT t.* FROM ucp-schema-name.TABLENAME t
Any idea how to add quotes around schema name in auto-generated SELECT query?
Please sign in to leave a comment.
What database and IDE version do you use? Do you use any proxy software(middleware) between database and the client (see https://youtrack.jetbrains.com/issue/DBE-8196#focus=streamItem-27-3433119.0-0 - issue when this middleware s/w does not support schema qualification).
Thanks for the answer! If I got it from the upper Idea issue, it's not possible at the moment, correct me if I'm not right.
I'm using Intellij Idea 2019.1.3, and I created SSH tunnel to my Ignite H2 database.
Your issue might be different. Could you provide screenshots with the conneciton settings (General and SSL/SSH tabs), the screenshots showing the problem in a full DataGrip window the idea.log (Help | Show Log in ... action) and database.log (Help | Show SQL Log in ... action) files after IDE restart and reproducing?
For uploading you can use ftp://ftp.intellij.net/.uploads / https://uploads.services.jetbrains.com or any file sharing service.
Please also try to select this schema as default shema for the console and check if it helps: https://www.jetbrains.com/help/datagrip/schemas.html#selecting_schema
I uploaded screenshot files and log:
So you can investigate in details.
Could be a jdbc driver issue: for some reason when non-quoted - it pases UTP to upper case. Or may be it fails to parse the hyphen in schema name without quotes. Does it work with other schema names?
Please upload also database.log after reproducing.
Since the DB log is full of sensitive data, I'll paste here part of the log which occurs on table double-click:
-- [ --------------------------------------------------
-- 2019-06-03 13:29:17 [Project] [H2 QA] [data editor: UCP-****-****.TABLENAME [H2 QA]] [session id: 1109515754] [statement id: 1418080119]
SELECT t.* FROM ucp-****-****.TABLENAME t
-- ] --------------------------------------------------
-- 2019-06-03 13:29:17 [Project] [H2 QA] [data editor: UCP-****-****.TABLENAME [H2 QA]] [session id: 1109515754] [statement id: 1418080119] error - [42000][1001] Failed to parse query. Table \"UCP\" not found; SQL statement:\nSELECT t.* FROM ucp-****-****.TABLENAME t [42102-197]
-- 2019-06-03 13:29:17 [Project] [H2 QA] [data editor: UCP-****-****.TABLENAME [H2 QA]] [session id: 1109515754] [statement id: 1418080119] finished - execution time: 20 ms
"Does it work with other schema names?" - No, all schemas have this ucp- prefix
Thank you for details. Filled the https://youtrack.jetbrains.com/issue/DBE-8453 Please feel free to vote and follow for updates.