diff --git a/CHANGELOG.md b/CHANGELOG.md index 82bdf1f234..07132aa683 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -125,6 +125,7 @@ With this release the systemd configuration files for InfluxDB will use the syst - [#7025](https://github.com/influxdata/influxdb/issues/7025): Move the CQ interval by the group by offset. - [#7125](https://github.com/influxdata/influxdb/pull/7125): Ensure gzip writer is closed in influx_inspect export - [#7127](https://github.com/influxdata/influxdb/pull/7127): Concurrent series limit +- [#7218](https://github.com/influxdata/influxdb/issues/7218): Fix alter retention policy when all options are used. ## v0.13.0 [2016-05-12] diff --git a/influxql/parser.go b/influxql/parser.go index c732441e90..c1f3a718fd 100644 --- a/influxql/parser.go +++ b/influxql/parser.go @@ -474,8 +474,8 @@ func (p *Parser) parseAlterRetentionPolicyStatement() (*AlterRetentionPolicyStat } stmt.Database = ident - // Loop through option tokens (DURATION, REPLICATION, DEFAULT, etc.). - maxNumOptions := 3 + // Loop through option tokens (DURATION, REPLICATION, SHARD DURATION, DEFAULT, etc.). + maxNumOptions := 4 Loop: for i := 0; i < maxNumOptions; i++ { tok, pos, lit := p.scanIgnoreWhitespace() diff --git a/influxql/parser_test.go b/influxql/parser_test.go index d10ea2af83..1ce3424417 100644 --- a/influxql/parser_test.go +++ b/influxql/parser_test.go @@ -1956,6 +1956,11 @@ func TestParser_ParseStatement(t *testing.T) { s: `ALTER RETENTION POLICY policy1 ON testdb REPLICATION 4 SHARD DURATION 10m`, stmt: newAlterRetentionPolicyStatement("policy1", "testdb", -1, 10*time.Minute, 4, false), }, + // ALTER RETENTION POLICY with all options + { + s: `ALTER RETENTION POLICY default ON testdb DURATION 0s REPLICATION 4 SHARD DURATION 10m DEFAULT`, + stmt: newAlterRetentionPolicyStatement("default", "testdb", time.Duration(0), 10*time.Minute, 4, true), + }, // SHOW STATS {