Skip to content

Quotes inside quotes still present #827

@Slach

Description

@Slach

I have deployed a new instance of Grafana v12.2.0 with the Altinity plugin for ClickHouse v3.4.6. I created a panel with this query and it looks good because I am using :raw
Grafana Query which works

SELECT $timeSeries AS t, host, avg(usage_user) 
FROM $table 
WHERE host LIKE '${host_prefix:raw}%' 
  AND $timeFilter 
GROUP BY host, t 
ORDER BY host, t

Rendered SQL - you can see the WHERE statement has correctly rendered single quotes

/* grafana dashboard='New dashboard', user=1 */
SELECT (intDiv(toUInt32("_time"), 1) * 1) * 1000 AS t, host, avg(usage_user) 
FROM telegraf.cpu 
WHERE host LIKE 'telegraf-%' 
  AND "_time" >= toDateTime(1758726162) AND "_time" <= toDateTime(1758727062) 
GROUP BY host, t 
ORDER BY host, t

However, when we do not use :raw , we see the double quote issue again. This causes the panel to error.
Grafana Query

SELECT $timeSeries AS t, host, avg(usage_user) 
FROM $table 
WHERE host LIKE '${host_prefix}%' 
  AND $timeFilter 
GROUP BY host, t 
ORDER BY host, t

Rendered SQL - double quote issue again in WHERE statement

/* grafana dashboard='New dashboard', user=1 */
SELECT (intDiv(toUInt32("_time"), 1) * 1) * 1000 AS t, host, avg(usage_user) 
FROM telegraf.cpu 
WHERE host LIKE ''telegraf-'%' 
  AND "_time" >= toDateTime(1758726162) AND "_time" <= toDateTime(1758727062) 
GROUP BY host, t 
ORDER BY host, t

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions