1
0
Fork 0

CLI now handles no rows correctly

master
Philip O'Toole 8 years ago
parent b248b0f4e1
commit b77130aa2c

@ -3,6 +3,7 @@
- [PR #149](https://github.com/rqlite/rqlite/pull/149): Support configurable Raft snapshot thresholds. - [PR #149](https://github.com/rqlite/rqlite/pull/149): Support configurable Raft snapshot thresholds.
- [PR #148](https://github.com/rqlite/rqlite/pull/148): Support pprof information over HTTP. - [PR #148](https://github.com/rqlite/rqlite/pull/148): Support pprof information over HTTP.
- [PR #154](https://github.com/rqlite/rqlite/pull/154): CLI now redirects to leader if necessary. - [PR #154](https://github.com/rqlite/rqlite/pull/154): CLI now redirects to leader if necessary.
- [PR #155](https://github.com/rqlite/rqlite/pull/155): CLI now handles "no rows" correctly.
## 3.2.1 (May 22nd 2016) ## 3.2.1 (May 22nd 2016)
- [PR #143](https://github.com/rqlite/rqlite/pull/143): Use DELETE as HTTP method to remove nodes. - [PR #143](https://github.com/rqlite/rqlite/pull/143): Use DELETE as HTTP method to remove nodes.

@ -34,6 +34,11 @@ func (r *Rows) Get(i, j int) string {
} }
return r.Columns[j] return r.Columns[j]
} }
if r.Values == nil {
return "NULL"
}
if i-1 >= len(r.Values) { if i-1 >= len(r.Values) {
return "NULL" return "NULL"
} }
@ -47,7 +52,7 @@ func (r *Rows) validate() error {
if r.Error != "" { if r.Error != "" {
return fmt.Errorf(r.Error) return fmt.Errorf(r.Error)
} }
if r.Columns == nil || r.Types == nil || r.Values == nil { if r.Columns == nil || r.Types == nil {
return fmt.Errorf("unexpected result") return fmt.Errorf("unexpected result")
} }
return nil return nil

Loading…
Cancel
Save