Browse Source

fix query string bug when value is nil (#692)

pull/689/head v0.6.3
Lunny Xiao 2 years ago
parent
commit
d7f04c3cec
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      session_raw.go

+ 3
- 3
session_raw.go View File

@ -219,16 +219,16 @@ func row2mapStr(rows *core.Rows, fields []string) (resultsMap map[string]string,
for ii, key := range fields {
rawValue := reflect.Indirect(reflect.ValueOf(scanResultContainers[ii]))
//if row is null then ignore
// if row is null then as empty string
if rawValue.Interface() == nil {
//fmt.Println("ignore ...", key, rawValue)
result[key] = ""
continue
}
if data, err := value2String(&rawValue); err == nil {
result[key] = data
} else {
return nil, err // !nashtsai! REVIEW, should return err or just error log?
return nil, err
}
}
return result, nil

Loading…
Cancel
Save