You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by fr...@apache.org on 2022/10/09 22:37:18 UTC
[calcite-avatica-go] 06/08: [CALCITE-5323] Do not copy lock handle in statement
This is an automated email from the ASF dual-hosted git repository.
francischuang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite-avatica-go.git
commit 50ab73a30fe4c28e05e2785d69001491b32c32ee
Author: Francis Chuang <fr...@apache.org>
AuthorDate: Mon Oct 10 09:20:38 2022 +1100
[CALCITE-5323] Do not copy lock handle in statement
---
connection.go | 2 +-
statement.go | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/connection.go b/connection.go
index 8fc6cdb..368dc34 100644
--- a/connection.go
+++ b/connection.go
@@ -60,7 +60,7 @@ func (c *conn) prepare(ctx context.Context, query string) (driver.Stmt, error) {
statementID: prepareResponse.Statement.Id,
conn: c,
parameters: prepareResponse.Statement.Signature.Parameters,
- handle: *prepareResponse.Statement,
+ handle: prepareResponse.Statement,
batchUpdates: make([]*message.UpdateBatch, 0),
}, nil
}
diff --git a/statement.go b/statement.go
index c9f9521..12822ef 100644
--- a/statement.go
+++ b/statement.go
@@ -32,7 +32,7 @@ type stmt struct {
statementID uint32
conn *conn
parameters []*message.AvaticaParameter
- handle message.StatementHandle
+ handle *message.StatementHandle
batchUpdates []*message.UpdateBatch
sync.Mutex
}
@@ -108,7 +108,7 @@ func (s *stmt) exec(ctx context.Context, args []namedValue) (driver.Result, erro
}
msg := &message.ExecuteRequest{
- StatementHandle: &s.handle,
+ StatementHandle: s.handle,
ParameterValues: values,
FirstFrameMaxSize: s.conn.config.frameMaxSize,
HasParameterValues: true,
@@ -153,7 +153,7 @@ func (s *stmt) query(ctx context.Context, args []namedValue) (driver.Rows, error
}
msg := &message.ExecuteRequest{
- StatementHandle: &s.handle,
+ StatementHandle: s.handle,
ParameterValues: s.parametersToTypedValues(args),
FirstFrameMaxSize: s.conn.config.frameMaxSize,
HasParameterValues: true,