Set the condition cursor instead of aux iterator when creating a nil condition cursor

A copy/paste error had nil cursors destined for a condition cursor get
set to the auxiliary cursor instead. When the number of conditions
exceeded the number of auxiliary fields, this would result in a stack
trace in some situations. When the number of conditions was less than or
equal to the number of auxiliary fields, it means that an auxiliary
cursor may have been overwritten with a nil cursor accidentally and a
leak might have happened since it was never closed.

Fixes #6859.
pull/6860/head
Jonathan A. Sternberg 2016-06-17 11:08:17 -05:00
parent 74cffdb7ab
commit 6e205ce135
2 changed files with 5 additions and 4 deletions

View File

@ -76,6 +76,7 @@ With this release the systemd configuration files for InfluxDB will use the syst
- [#6834](https://github.com/influxdata/influxdb/pull/6834): Add port to all graphite log output to help with debugging multiple endpoints - [#6834](https://github.com/influxdata/influxdb/pull/6834): Add port to all graphite log output to help with debugging multiple endpoints
- [#6850](https://github.com/influxdata/influxdb/pull/6850): Modify the max nanosecond time to be one nanosecond less. - [#6850](https://github.com/influxdata/influxdb/pull/6850): Modify the max nanosecond time to be one nanosecond less.
- [#6824](https://github.com/influxdata/influxdb/issues/6824): Remove systemd output redirection. - [#6824](https://github.com/influxdata/influxdb/issues/6824): Remove systemd output redirection.
- [#6859](https://github.com/influxdata/influxdb/issues/6859): Set the condition cursor instead of aux iterator when creating a nil condition cursor.
## v0.13.0 [2016-05-12] ## v0.13.0 [2016-05-12]

View File

@ -1147,16 +1147,16 @@ func (e *Engine) createVarRefSeriesIterator(ref *influxql.VarRef, mm *tsdb.Measu
// If a field was requested, use a nil cursor of the requested type. // If a field was requested, use a nil cursor of the requested type.
switch ref.Type { switch ref.Type {
case influxql.Float, influxql.AnyField: case influxql.Float, influxql.AnyField:
aux[i] = &floatNilLiteralCursor{} conds[i] = &floatNilLiteralCursor{}
continue continue
case influxql.Integer: case influxql.Integer:
aux[i] = &integerNilLiteralCursor{} conds[i] = &integerNilLiteralCursor{}
continue continue
case influxql.String: case influxql.String:
aux[i] = &stringNilLiteralCursor{} conds[i] = &stringNilLiteralCursor{}
continue continue
case influxql.Boolean: case influxql.Boolean:
aux[i] = &booleanNilLiteralCursor{} conds[i] = &booleanNilLiteralCursor{}
continue continue
} }
} }