[Groonga-commit] groonga/grnci at d5f93db [master] Fix a bug that DB.Load() and DB.Select() panic with index out of range

Back to archive index

Susumu Yata null+****@clear*****
Thu Feb 11 13:32:46 JST 2016


Susumu Yata	2016-02-11 13:32:46 +0900 (Thu, 11 Feb 2016)

  New Revision: d5f93db045fefa606ef34aaec0d07f90a95b73a8
  https://github.com/groonga/grnci/commit/d5f93db045fefa606ef34aaec0d07f90a95b73a8

  Message:
    Fix a bug that DB.Load() and DB.Select() panic with index out of range

  Modified files:
    grnci.go

  Modified: grnci.go (+2 -2)
===================================================================
--- grnci.go    2016-02-11 13:30:07 +0900 (802246c)
+++ grnci.go    2016-02-11 13:32:46 +0900 (b3f0691)
@@ -1706,7 +1706,7 @@ func (db *DB) Load(tbl string, vals interface{}, options *LoadOptions) (int, err
 			cols = append(cols, fields[i].ColumnName())
 		}
 	} else {
-		fields = make([]*FieldInfo, 0, len(cols))
+		fields = make([]*FieldInfo, len(cols))
 		for i, col := range cols {
 			if fields[i] = info.FieldByColumnName(col); fields[i] == nil {
 				return 0, fmt.Errorf("column name %#v not found", col)
@@ -2021,7 +2021,7 @@ func (db *DB) Select(tbl string, vals interface{}, options *SelectOptions) (int,
 			cols = append(cols, fields[i].ColumnName())
 		}
 	} else {
-		fields = make([]*FieldInfo, 0, len(cols))
+		fields = make([]*FieldInfo, len(cols))
 		for i, col := range cols {
 			if fields[i] = info.FieldByColumnName(col); fields[i] == nil {
 				return 0, fmt.Errorf("column name %#v not found", col)
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index