diff --git a/plugins/chain.go b/plugins/chain.go index 6edb440..8f3d67f 100644 --- a/plugins/chain.go +++ b/plugins/chain.go @@ -2,7 +2,6 @@ package plugins import ( "context" - "sort" "github.com/Velocidex/ordereddict" "www.velocidex.com/golang/vfilter/arg_parser" @@ -26,8 +25,9 @@ func (self _ChainPlugin) Call( output_chan := make(chan types.Row) queries := []types.StoredQuery{} + + // Maintain definition order for the chain plugin. members := scope.GetMembers(args) - sort.Strings(members) go func() { defer close(output_chan) diff --git a/protocols/protocol_lt.go b/protocols/protocol_lt.go index 1083883..5123161 100644 --- a/protocols/protocol_lt.go +++ b/protocols/protocol_lt.go @@ -32,7 +32,7 @@ func (self LtDispatcher) Copy() LtDispatcher { func intLt(lhs int64, b types.Any) bool { switch b.(type) { - case int, int8, int16, int32, int64, uint8, uint16, uint32, uint64: + case bool, int, int8, int16, int32, int64, uint8, uint16, uint32, uint64: rhs, _ := utils.ToInt64(b) return lhs < rhs case float64, float32: @@ -43,15 +43,13 @@ func intLt(lhs int64, b types.Any) bool { } func intEq(lhs int64, b types.Any) bool { - switch t := b.(type) { - case int, int8, int16, int32, int64, uint8, uint16, uint32, uint64: + switch b.(type) { + case bool, int, int8, int16, int32, int64, uint8, uint16, uint32, uint64: rhs, _ := utils.ToInt64(b) return lhs == rhs case float64, float32: rhs, _ := utils.ToFloat(b) return float64(lhs) == rhs - case bool: - return lhs != 0 == t } return false } @@ -75,7 +73,7 @@ func (self LtDispatcher) Lt(scope types.Scope, a types.Any, b types.Any) bool { } // If it is integer like, coerce to int. - case int, int8, int16, int32, int64, uint8, uint16, uint32, uint64: + case bool, int, int8, int16, int32, int64, uint8, uint16, uint32, uint64: if isTime(b) { lhs, ok := utils.ToInt64(t) if ok {