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

Fix AST parser regexp error for backslash-single quote \' #123

Closed
wants to merge 1 commit into from
Closed

Fix AST parser regexp error for backslash-single quote \' #123

wants to merge 1 commit into from

Conversation

it1804
Copy link
Contributor

@it1804 it1804 commented Apr 19, 2019

The AST parser does not take into account the presence of backslashed single quotes, and the parsed token is truncated on them. Tested on plugin version 1.8.1 and Grafana 6.1.4.

Simple query:
SELECT arrayJoin(arrayMap(x -> MACStringToNum(x), splitByChar(',', replaceRegexpAll(replaceRegexpAll(toString(['CC:09:C8:08:50:2B','00:1A:79:06:3C:93']),'[\\[\\]\' \t\n]', ''),'([A-F0-9]+)','\\1'))))

Сhrome developer console:
AST parser error: cannot find next token in [\t\n]', ''), '([A-F0-9]+)', '\\1'))))]

This patch should fix it.

@alex-zaitsev
Copy link
Member

alex-zaitsev commented Aug 1, 2019

@it1804, Please add a test if possible.

@Slach
Copy link
Collaborator

Slach commented Jun 15, 2020

@it1804 thanks you for your PR

Slach added a commit to Altinity/grafana-plugin-repository that referenced this pull request Jun 17, 2020
# 2.0.0 (2020-06-17)

## Enhancements:
* compatibility with grafana 7.x, please use environment variable `GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=vertamedia-clickhouse-datasource` or `allow_loading_unsigned_plugins=vertamedia-clickhouse-datasource` in plugins section of `grafana.ini` Altinity/clickhouse-grafana#192
* add grafana 7.x alerting support thanks to Brian Thai https://github.com/bmanth60
* add alias support to $perSecondColumns macro Altinity/clickhouse-grafana#193
* Support `custom` variable type and empty values for `$conditionalTest` macro Altinity/clickhouse-grafana#178
* add docker-compose.yaml to improve local development

## Fixes:
* fix AST for corner case when quotes escaped inside quotes Altinity/clickhouse-grafana#123, Altinity/clickhouse-grafana#195
* fix Altinity/clickhouse-grafana#179,  add "Extrapolation" checkbox to Query Editor

Signed-off-by: Slach <bloodjazman@gmail.com>
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

Successfully merging this pull request may close these issues.

3 participants