Skip to content

Commit

Permalink
spanner: make PartitionedUpdate treat query parameters
Browse files Browse the repository at this point in the history
Fixes #1472

Change-Id: I609fdd0897c91e9a4e77a38251316113a1a9e3d3
Reviewed-on: https://code-review.googlesource.com/c/gocloud/+/41450
Reviewed-by: Jean de Klerk <deklerk@google.com>
  • Loading branch information
110y authored and jeanbza committed Jun 24, 2019
1 parent 3044cc1 commit b1eefbd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion spanner/pdml.go
Expand Up @@ -69,12 +69,20 @@ func (c *Client) PartitionedUpdate(ctx context.Context, statement Statement) (co
if err != nil {
return 0, toSpannerError(err)
}

params, paramTypes, err := statement.convertParams()
if err != nil {
return 0, toSpannerError(err)
}

req := &sppb.ExecuteSqlRequest{
Session: sh.getID(),
Transaction: &sppb.TransactionSelector{
Selector: &sppb.TransactionSelector_Id{Id: tx},
},
Sql: statement.SQL,
Sql: statement.SQL,
Params: params,
ParamTypes: paramTypes,
}
rpc := func(ctx context.Context, resumeToken []byte) (streamingReceiver, error) {
req.ResumeToken = resumeToken
Expand Down

0 comments on commit b1eefbd

Please sign in to comment.