I'm using firebird database driver from "github.com/nakagami/firebirdsql" with GO1.11 + FB2.5
But I can't get prepared SELECT to work, it throws "Error op_response:0" error when executing the 2nd QUERYROW(). Any ideas?
Is there any alternative driver? Or am I using incorrect driver?
func test1(tx *sql.Tx) {
sqlStr := "SELECT number FROM order WHERE id=?"
stmt, err := tx.Prepare(sqlStr)
if err != nil {
panic(err.Error())
}
var value string
err = stmt.QueryRow(123).Scan(&value)
if err != nil {
panic(err.Error())
}
fmt.Println(value)
err = stmt.QueryRow(200).Scan(&value)
if err != nil {
panic(err.Error())
}
fmt.Println(value)
}
Result:
INV20183121
panic: Error op_response:0
goroutine 1 [running]:
main.test1(0xc00009c000, 0xc0000a8200)
I can venture a guess. Looking at github.com/nakagami/firebirdsql
sources, this seems to be the only code path which can produce this error. Looking here, it ignores any network errors returned by recvPackets
, which means: any thing on the network socket breaks, and you get this error back (because that's what recvPackets
returns in case of network error).
I'd suggest rebuilding your code with debugPrint
code uncommented, and see what is actually going on on the network connection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With