Merge pull request #7219 from influxdata/js-7218-alter-retention-policy-parsing-error

Fix alter retention policy when all options are used
pull/7232/head
Jonathan A. Sternberg 2016-08-29 10:03:09 -05:00 committed by GitHub
commit 05d1a948d0
3 changed files with 8 additions and 2 deletions

View File

@ -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]

View File

@ -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()

View File

@ -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
{