2
0

Fix queries with more than 32 columns

fixes #270
This commit is contained in:
Jack Christensen
2017-05-01 19:46:37 -05:00
parent d25abf5674
commit eb9fc6e7a5
+5 -1
View File
@@ -25,7 +25,11 @@ func (dst *DataRow) Decode(src []byte) error {
// large reallocate. This is too avoid one row with many columns from
// permanently allocating memory.
if cap(dst.Values) < fieldCount || cap(dst.Values)-fieldCount > 32 {
dst.Values = make([][]byte, fieldCount, 32)
newCap := 32
if newCap < fieldCount {
newCap = fieldCount
}
dst.Values = make([][]byte, fieldCount, newCap)
} else {
dst.Values = dst.Values[:fieldCount]
}