You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "williamleven (via GitHub)" <gi...@apache.org> on 2023/12/05 12:39:43 UTC
[I] go/adbc/sqldriver: Unable to pass arguments to queries [arrow-adbc]
williamleven opened a new issue, #1341:
URL: https://github.com/apache/arrow-adbc/issues/1341
Passing arguments to queries in the go/adbc/sqldriver package results in nil pointer, and array index out of bounds panics.
Working example: (from repository [go/adbc/sqldriver/driver_test.go#L30](https://github.com/apache/arrow-adbc/blob/main/go/adbc/sqldriver/driver_test.go#L30))
```go
sql.Register("adbc", sqldriver.Driver{&drivermgr.Driver{}})
// AdbcDriverInit is the assumed entrypoint by default, but i'll keep
// it specified explicitly here for demonstration purposes.
// this also assumes that libadbc_driver_sqlite.so is on your LD_LIBRARY_PATH
db, err := sql.Open("adbc", "driver=adbc_driver_sqlite;entrypoint=AdbcDriverInit")
if err != nil {
panic(err)
}
rows, err := db.Query("SELECT 1") // Query row
if err != nil {
panic(err)
}
defer rows.Close()
```
It seems like all kinds of arguments added to the query causes problems for the driver:
* Replacing the query row with `db.Query("SELECT ?", 1)` results in `panic: runtime error: invalid memory address or nil pointer dereference`
* Replacing the query argument with a dynamic length type `db.Query("SELECT ?", "1")` causes another panic `panic: runtime error: index out of range [2] with length 2`.
* Unsupported types also give a nil pointer panic.
As already documented by https://github.com/apache/arrow-adbc/issues/401 it seems like this code lacks some essential tests and isn't really used by anyone as this problem has gone undetected for some time. Alternatively, I may have misunderstood how to use it as I'm running into problems previously not documented?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] go/adbc/sqldriver: Unable to pass arguments to queries [arrow-adbc]
Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade closed issue #1341: go/adbc/sqldriver: Unable to pass arguments to queries
URL: https://github.com/apache/arrow-adbc/issues/1341
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] go/adbc/sqldriver: Unable to pass arguments to queries [arrow-adbc]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #1341:
URL: https://github.com/apache/arrow-adbc/issues/1341#issuecomment-1840829943
We're mostly just short on hands. Thanks for the report and the PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org