Fixed {Write,Query}Result to set Err properly.
This commit is contained in:
parent
84577f05d1
commit
f5df4898a3
4
query.go
4
query.go
|
@ -159,8 +159,8 @@ func (conn *Connection) Query(sqlStatements []string) (results []QueryResult, er
|
||||||
// did we get an error?
|
// did we get an error?
|
||||||
_, ok := thisResult["error"]
|
_, ok := thisResult["error"]
|
||||||
if ok {
|
if ok {
|
||||||
trace("%s: have an error this this result: %s",conn.ID,thisResult["error"].(string))
|
trace("%s: have an error on this result: %s",conn.ID,thisResult["error"].(string))
|
||||||
thisQR.Err = err
|
thisQR.Err = errors.New(thisResult["error"].(string))
|
||||||
results = append(results,thisQR)
|
results = append(results,thisQR)
|
||||||
numStatementErrors++
|
numStatementErrors++
|
||||||
continue
|
continue
|
||||||
|
|
4
write.go
4
write.go
|
@ -127,8 +127,8 @@ func (conn *Connection) Write(sqlStatements []string) (results []WriteResult, er
|
||||||
// did we get an error?
|
// did we get an error?
|
||||||
_, ok := thisResult["error"]
|
_, ok := thisResult["error"]
|
||||||
if ok {
|
if ok {
|
||||||
trace("%s: have an error this this result: %s",conn.ID,thisResult["error"].(string))
|
trace("%s: have an error on this result: %s",conn.ID,thisResult["error"].(string))
|
||||||
thisWR.Err = err
|
thisWR.Err = errors.New(thisResult["error"].(string))
|
||||||
results = append(results,thisWR)
|
results = append(results,thisWR)
|
||||||
numStatementErrors += 1
|
numStatementErrors += 1
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue