You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
query = "SHOW MEASUREMENTS ON " + std::string(db);
There is no escape for database name, it could not work if database name is for example my-db.
test02=# create extension influxdb_fdw ;
CREATE EXTENSION
test02=# CREATE SERVER influxdb_svr FOREIGN DATA WRAPPER influxdb_fdw OPTIONS (
dbname 'my-db', host 'http://172.17.0.1', port '18086', version '1');
CREATE SERVER
test02=# CREATE USER MAPPING FOR "xxx" SERVER influxdb_svr OPTIONS ( user 'xxx', password 'xxx');
CREATE USER MAPPING
test02=# create schema "30d";
CREATE SCHEMA
test02=# IMPORT FOREIGN SCHEMA "30d" FROM SERVER influxdb_svr INTO "30d";
ERROR: influxdb_fdw : influx-cxx [treatCurlResponse]: Bad request: CODE: invalid, MESSAGE: failed to parse query: found -, expected ; at line 1, char 29
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.
influxdb_fdw/query.cpp
Line 65 in 7bb0e4c
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:
influxdb_fdw/influxdb_fdw.c
Line 4256 in 7bb0e4c
There is also a function
influxdb_quote_identifier
- but it seems, it is implemented differently than the original InfluxDB quote identifier.influxdb_fdw/deparse.c
Line 315 in 7bb0e4c
And also in go client.
influxdb_fdw/query.go
Line 162 in 7bb0e4c
Kind regards
Antoni Jakubiak
The text was updated successfully, but these errors were encountered: