From dd63591daeb2e878267936a34b386b0b56156d52 Mon Sep 17 00:00:00 2001 From: Joop Kiefte Date: Fri, 30 Oct 2015 10:07:00 +0100 Subject: [PATCH] Bugfix for #62 This fixes it for me locally. (First had the second part of the slice set to the size of the buffer, but of course that's completely senseless...) --- column.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/column.go b/column.go index fcc5a3c..1587f85 100644 --- a/column.go +++ b/column.go @@ -237,6 +237,9 @@ func (c *BindableColumn) Value(h api.SQLHSTMT, idx int) (driver.Value, error) { if !c.IsVariableWidth && int(c.Len) != c.Size { panic(fmt.Errorf("wrong column #%d length %d returned, %d expected", idx, c.Len, c.Size)) } + if len(c.Buffer) < int(c.Len) { + return c.BaseColumn.Value(c.Buffer) + } return c.BaseColumn.Value(c.Buffer[:c.Len]) }