Open AntoniJakubiak opened 3 months ago
Here is a link to InfluxDB (go) code for escaping idents: https://github.com/influxdata/influxql/blob/master/parser.go#L3124 https://github.com/influxdata/influxql/blob/master/parser_test.go#L4259
Dear @AntoniJakubiak ,
Thank you for highlighting the escaping issue with database names in InfluxDB FDW and for your detailed report. We acknowledge the problem and appreciate your contribution to identifying it. Based on your report, we will investigate this issue further and aim to implement a fix in the next release of InfluxDB FDW.
Thank you once again for your contribution. We look forward to any further insights you might have in the future and appreciate your support in enhancing InfluxDB FDW.
Hi,
Please check this code.
https://github.com/pgspider/influxdb_fdw/blob/7bb0e4c9ce6541327f006cc7d2fab74721168788/query.cpp#L65
There is no escape for database name, it could not work if database name is for example
my-db
.The similar code is used on lines L65, L91, L489.
A similar bug could be also here: https://github.com/pgspider/influxdb_fdw/blob/7bb0e4c9ce6541327f006cc7d2fab74721168788/influxdb_fdw.c#L4256
There is also a function
influxdb_quote_identifier
- but it seems, it is implemented differently than the original InfluxDB quote identifier. https://github.com/pgspider/influxdb_fdw/blob/7bb0e4c9ce6541327f006cc7d2fab74721168788/deparse.c#L315And also in go client. https://github.com/pgspider/influxdb_fdw/blob/7bb0e4c9ce6541327f006cc7d2fab74721168788/query.go#L162
Kind regards Antoni Jakubiak