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
When running multiple queries separated by semicolon, when one of the queries (which is not the last query) is a CREATE REPLICATION POLICY query does not end in DEFAULT (for example, CREATE RETENTION POLICY "10m.events" ON somedb DURATION 60m REPLICATION <int>; SELECT a from somedb), the query fails with an error unexpected error: found SELECT, expected ; at line 1, char 61
I've tried a lot of other multiple queries, but the only ones that fail are when it CREATE RETENTION POLICY does not end with DEFAULT.
System info: InfluxDB 0.12.1-1 running on Ubuntu 14.04.4 LTS (GNU/Linux 3.13.0-79-generic x86_64) installed via RPM, within docker image tutum/influxdb:0.12, and installed from source using your build-docker.sh script.
Steps to reproduce:
Using InfluxCLI, HTTP query, client libraries, admin interface, run multiple queries where the first query is CREATE RETENTION POLICY "10m.events" ON somedb DURATION 60m REPLICATION <int> {SHARD DURATION 30m} and the second query is anything, and the two queries are separated by a ; semicolon.
error is returned: ERR: error parsing query: found SELECT, expected ; at line 1, char 86
Retention policy is not created
Expected behavior: Creation of retention policy and results from second query
Actual behavior: Parsing Error ERR: error parsing query: found SELECT, expected ; at line 1, char 86, retention policy not created, no results returned
Additional info:
Sample of multiple queries that work and do not work. If you switch the queries to SELECT is first and CREATE RETENTION POLICY is last, it works as expected. But if you add another query after CREATE RETENTION POLICY, you receive an error.
Also, there are no errors if you use two semicolons ;; after CREATE RETENTION POLICY.
> CREATE RETENTION POLICY rp_90d2 on db duration 90d REPLICATION 2 SHARD DURATION 30m DEFAULT; select * from db;
> show retention policies
ERR: error parsing query: found EOF, expected ON at line 1, char 25
> show retention policies on db
name duration shardGroupDuration replicaN default
default 0 168h0m0s 1 false
rp_90d2 2160h0m0s 30m0s 2 true
> CREATE RETENTION POLICY rp_90d3 on db duration 90d REPLICATION 2 SHARD DURATION 30m; select * from db;
ERR: error parsing query: found SELECT, expected ; at line 1, char 86
> show retention policies on db
name duration shardGroupDuration replicaN default
default 0 168h0m0s 1 false
rp_90d2 2160h0m0s 30m0s 2 true
> CREATE RETENTION POLICY rp_90d4 on db duration 90d REPLICATION 2; select * from db;
ERR: error parsing query: found SELECT, expected ; at line 1, char 67
> show retention policies on db
name duration shardGroupDuration replicaN default
default 0 168h0m0s 1 false
rp_90d2 2160h0m0s 30m0s 2 true
> CREATE RETENTION POLICY rp_90d4 on db duration 90d REPLICATION 2 DEFAULT; select * from db;
> show retention policies on db
name duration shardGroupDuration replicaN default
default 0 168h0m0s 1 false
rp_90d2 2160h0m0s 30m0s 2 false
rp_90d4 2160h0m0s 24h0m0s 2 true
The text was updated successfully, but these errors were encountered:
…houldn't
The optional sections of the command consumed the semicolon token and
didn't put it back for the outer loop. The code shouldn't explicitly
check for a semicolon or EOF anyway, so these checks were removed and
the token gets unscanned if it doesn't match the optional token that the
parser is looking for.
Fixes#6398.
Bug report
When running multiple queries separated by semicolon, when one of the queries (which is not the last query) is a CREATE REPLICATION POLICY query does not end in
DEFAULT
(for example,CREATE RETENTION POLICY "10m.events" ON somedb DURATION 60m REPLICATION <int>; SELECT a from somedb
), the query fails with an errorunexpected error: found SELECT, expected ; at line 1, char 61
I've tried a lot of other multiple queries, but the only ones that fail are when it CREATE RETENTION POLICY does not end with
DEFAULT
.System info: InfluxDB 0.12.1-1 running on Ubuntu 14.04.4 LTS (GNU/Linux 3.13.0-79-generic x86_64) installed via RPM, within docker image tutum/influxdb:0.12, and installed from source using your
build-docker.sh
script.Steps to reproduce:
CREATE RETENTION POLICY "10m.events" ON somedb DURATION 60m REPLICATION <int> {SHARD DURATION 30m}
and the second query is anything, and the two queries are separated by a;
semicolon.ERR: error parsing query: found SELECT, expected ; at line 1, char 86
Expected behavior: Creation of retention policy and results from second query
Actual behavior: Parsing Error
ERR: error parsing query: found SELECT, expected ; at line 1, char 86
, retention policy not created, no results returnedAdditional info:
Sample of multiple queries that work and do not work. If you switch the queries to
SELECT
is first andCREATE RETENTION POLICY
is last, it works as expected. But if you add another query afterCREATE RETENTION POLICY
, you receive an error.Also, there are no errors if you use two semicolons
;;
afterCREATE RETENTION POLICY
.The text was updated successfully, but these errors were encountered: