From 722b6345fecdd8b6f3e491ac3c2f28b6da38edf2 Mon Sep 17 00:00:00 2001 From: Mark Rushakoff Date: Mon, 19 Dec 2016 09:31:26 -0800 Subject: [PATCH] Fix unchecked error in templated Read${TYPE}Block --- tsdb/engine/tsm1/file_store.gen.go | 12 ++++++++++++ tsdb/engine/tsm1/file_store.gen.go.tmpl | 3 +++ 2 files changed, 15 insertions(+) diff --git a/tsdb/engine/tsm1/file_store.gen.go b/tsdb/engine/tsm1/file_store.gen.go index bf2ae09bd0..27a70d0b2e 100644 --- a/tsdb/engine/tsm1/file_store.gen.go +++ b/tsdb/engine/tsm1/file_store.gen.go @@ -17,6 +17,9 @@ func (c *KeyCursor) ReadFloatBlock(buf *[]FloatValue) ([]FloatValue, error) { first := c.current[0] *buf = (*buf)[:0] values, err := first.r.ReadFloatBlockAt(&first.entry, buf) + if err != nil { + return nil, err + } // Remove values we already read values = FloatValues(values).Exclude(first.readMin, first.readMax) @@ -177,6 +180,9 @@ func (c *KeyCursor) ReadIntegerBlock(buf *[]IntegerValue) ([]IntegerValue, error first := c.current[0] *buf = (*buf)[:0] values, err := first.r.ReadIntegerBlockAt(&first.entry, buf) + if err != nil { + return nil, err + } // Remove values we already read values = IntegerValues(values).Exclude(first.readMin, first.readMax) @@ -337,6 +343,9 @@ func (c *KeyCursor) ReadStringBlock(buf *[]StringValue) ([]StringValue, error) { first := c.current[0] *buf = (*buf)[:0] values, err := first.r.ReadStringBlockAt(&first.entry, buf) + if err != nil { + return nil, err + } // Remove values we already read values = StringValues(values).Exclude(first.readMin, first.readMax) @@ -497,6 +506,9 @@ func (c *KeyCursor) ReadBooleanBlock(buf *[]BooleanValue) ([]BooleanValue, error first := c.current[0] *buf = (*buf)[:0] values, err := first.r.ReadBooleanBlockAt(&first.entry, buf) + if err != nil { + return nil, err + } // Remove values we already read values = BooleanValues(values).Exclude(first.readMin, first.readMax) diff --git a/tsdb/engine/tsm1/file_store.gen.go.tmpl b/tsdb/engine/tsm1/file_store.gen.go.tmpl index 164b6baac3..f7a0aca904 100644 --- a/tsdb/engine/tsm1/file_store.gen.go.tmpl +++ b/tsdb/engine/tsm1/file_store.gen.go.tmpl @@ -13,6 +13,9 @@ func (c *KeyCursor) Read{{.Name}}Block(buf *[]{{.Name}}Value) ([]{{.Name}}Value, first := c.current[0] *buf = (*buf)[:0] values, err := first.r.Read{{.Name}}BlockAt(&first.entry, buf) + if err != nil { + return nil, err + } // Remove values we already read values = {{.Name}}Values(values).Exclude(first.readMin, first.readMax)