Open
Description
What happened:
my database has column names that include colons, e.g verification:id
. the Query Builder mode in Grafana does not quote them, resulting in invalid SQL ala:
SELECT verification:id FROM "default"."verifications" LIMIT 1000
and syntax errors:
error querying the database: code: 62, message: Syntax error: failed at position 24 ('FROM'): FROM "default"."verifications" LIMIT 1000. Expected one of: token, Dot, OR, AND, IS NOT DISTINCT FROM, IS NULL, IS NOT NULL, BETWEEN, NOT BETWEEN, LIKE, ILIKE, NOT LIKE, NOT ILIKE, REGEXP, IN, NOT IN, GLOBAL IN, GLOBAL NOT IN, MOD, DIV
What you expected to happen:
the column names should be quoted. switching to SQL Editor mode and manually quoting the column name fixes the issue:
SELECT "verification:id" FROM "default"."verifications" LIMIT 1000
How to reproduce it (as minimally and precisely as possible):
- create table with a problematic column name in ClickHouse:
CREATE TABLE "default"."test" (
"my:name" String
)
ENGINE MergeTree()
ORDER BY tuple()
- go to Explore mode in Grafana
- try and query the table, including the
my:name
column. the error occurs.
Environment:
- Grafana version: Grafana v11.3.0 (d9455ff7db) (running via Docker)
- Plugin version: 4.0.2
- OS Grafana is installed on: Docker on MacOS
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Incoming