This is an automated email from the ASF dual-hosted git repository.
lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new 41c5efc fix(go/adbc/driver/flightsql): send headers in statement
close (#494)
41c5efc is described below
commit 41c5efcca9273618453b92a8af088336d81657b5
Author: David Li <[email protected]>
AuthorDate: Wed Mar 8 14:08:16 2023 -0500
fix(go/adbc/driver/flightsql): send headers in statement close (#494)
Fixes #493.
---
go/adbc/driver/flightsql/flightsql_adbc_test.go | 17 +++++++++++++++++
go/adbc/driver/flightsql/flightsql_statement.go | 2 +-
go/adbc/go.mod | 4 ++--
go/adbc/go.sum | 8 ++++----
4 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/go/adbc/driver/flightsql/flightsql_adbc_test.go
b/go/adbc/driver/flightsql/flightsql_adbc_test.go
index c73a8fb..664644e 100644
--- a/go/adbc/driver/flightsql/flightsql_adbc_test.go
+++ b/go/adbc/driver/flightsql/flightsql_adbc_test.go
@@ -689,6 +689,23 @@ func (suite *HeaderTests) TestCombined() {
suite.Contains(suite.Quirks.middle.recordedHeaders.Get("x-header-three"),
"value 3")
}
+func (suite *HeaderTests) TestPrepared() {
+ stmt, err := suite.Cnxn.NewStatement()
+ suite.Require().NoError(err)
+
+ suite.Require().NoError(stmt.SetSqlQuery("timeout"))
+
+ suite.Require().NoError(suite.Cnxn.(adbc.PostInitOptions).
+ SetOption("adbc.flight.sql.rpc.call_header.x-header-one",
"value 1"))
+ suite.Require().NoError(stmt.Prepare(suite.ctx))
+
+
suite.Require().NoError(stmt.SetOption("adbc.flight.sql.rpc.call_header.x-header-two",
"value 2"))
+ suite.Require().NoError(stmt.Close())
+
+ suite.Contains(suite.Quirks.middle.recordedHeaders.Get("x-header-one"),
"value 1")
+ suite.Contains(suite.Quirks.middle.recordedHeaders.Get("x-header-two"),
"value 2")
+}
+
type TimeoutTestServer struct {
flightsql.BaseServer
}
diff --git a/go/adbc/driver/flightsql/flightsql_statement.go
b/go/adbc/driver/flightsql/flightsql_statement.go
index 1429d07..0d5c9b4 100644
--- a/go/adbc/driver/flightsql/flightsql_statement.go
+++ b/go/adbc/driver/flightsql/flightsql_statement.go
@@ -112,7 +112,7 @@ type statement struct {
}
func (s *statement) closePreparedStatement() error {
- return s.prepared.Close(context.Background(), s.timeouts)
+ return
s.prepared.Close(metadata.NewOutgoingContext(context.Background(), s.hdrs),
s.timeouts)
}
// Close releases any relevant resources associated with this statement
diff --git a/go/adbc/go.mod b/go/adbc/go.mod
index e284c6c..6ba0443 100644
--- a/go/adbc/go.mod
+++ b/go/adbc/go.mod
@@ -20,7 +20,7 @@ module github.com/apache/arrow-adbc/go/adbc
go 1.18
require (
- github.com/apache/arrow/go/v12 v12.0.0-20230217202445-03463dec5f92
+ github.com/apache/arrow/go/v12 v12.0.0-20230307201612-6fdf1e520a76
github.com/bluele/gcache v0.0.2
github.com/stretchr/testify v1.8.1
golang.org/x/exp v0.0.0-20230206171751-46f607a40771
@@ -34,7 +34,7 @@ require (
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/apache/thrift v0.17.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/dustin/go-humanize v1.0.0 // indirect
+ github.com/dustin/go-humanize v1.0.1 // indirect
github.com/goccy/go-json v0.10.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
diff --git a/go/adbc/go.sum b/go/adbc/go.sum
index 1afbfe0..7091980 100644
--- a/go/adbc/go.sum
+++ b/go/adbc/go.sum
@@ -1,8 +1,8 @@
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c
h1:RGWPOewvKIROun94nF7v2cua9qP+thov/7M50KEoeSU=
github.com/andybalholm/brotli v1.0.4
h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY=
github.com/andybalholm/brotli v1.0.4/go.mod
h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
-github.com/apache/arrow/go/v12 v12.0.0-20230217202445-03463dec5f92
h1:KIxA6iY3SPKpNxJMO/a8gTcvEvoNyxAtYBLGYZzloSU=
-github.com/apache/arrow/go/v12 v12.0.0-20230217202445-03463dec5f92/go.mod
h1:qwJWRMGOu/SUTlFiQBgCjtOoxYqdG2KqXiDB3+e7BNA=
+github.com/apache/arrow/go/v12 v12.0.0-20230307201612-6fdf1e520a76
h1:6O9PR51TZFveY6xYg4RCCj23hIFyL7vR5hav0zc+Vss=
+github.com/apache/arrow/go/v12 v12.0.0-20230307201612-6fdf1e520a76/go.mod
h1:p9SbFzxqBIUcxDFFqy4aLDT6RdooPoA18Bru+OL1gbk=
github.com/apache/thrift v0.17.0
h1:cMd2aj52n+8VoAtvSvLn4kDC3aZ6IAkBuqWQ2IDu7wo=
github.com/apache/thrift v0.17.0/go.mod
h1:OLxhMRJxomX+1I/KUw03qoV3mMz16BwaKI+d4fPBx7Q=
github.com/bluele/gcache v0.0.2 h1:WcbfdXICg7G/DGBh1PFfcirkWOQV+v077yF1pSy3DGw=
@@ -11,8 +11,8 @@ github.com/creack/pty v1.1.9/go.mod
h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/davecgh/go-spew v1.1.0/go.mod
h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1
h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod
h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/dustin/go-humanize v1.0.0
h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
-github.com/dustin/go-humanize v1.0.0/go.mod
h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
+github.com/dustin/go-humanize v1.0.1
h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
+github.com/dustin/go-humanize v1.0.1/go.mod
h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/goccy/go-json v0.10.0
h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA=
github.com/goccy/go-json v0.10.0/go.mod
h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/golang/protobuf v1.5.0/go.mod
h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=