sijms / go-ora

Pure go oracle client
MIT License
795 stars 176 forks source link

Fix problem caused by not handling error #565

Closed Ranxy closed 2 months ago

Ranxy commented 3 months ago

During usage, we encountered a Panic error:

error: interface conversion: driver.Rows is nil, not *go_ora.DataSet
runtime.panicdottypeE
    /usr/local/go/src/runtime/iface.go:262
runtime.panicdottypeI
    /usr/local/go/src/runtime/iface.go:272
github.com/sijms/go-ora/v2.(*Connection).QueryRowContext
    /go/pkg/mod/github.com/sijms/go-ora/v2@v2.8.19/connection.go:1083
github.com/sijms/go-ora/v2.(*Connection).getDBTimeZone
    /go/pkg/mod/github.com/sijms/go-ora/v2@v2.8.19/connection.go:509
github.com/sijms/go-ora/v2.(*Connection).dataTypeNegotiation
    /go/pkg/mod/github.com/sijms/go-ora/v2@v2.8.19/connection.go:1289

After investigation, it seems that the issue was caused by not handling the error in the code. Therefore, submitted this PR to resolve the problem and also fixed #564

sijms commented 2 months ago

thanks for contribution