Skip to content

[Flight SQL] ClosePreparedStatement uses original handle instead of updated handle from server #1117

@erick-alcachofa

Description

@erick-alcachofa

Describe the bug, including details regarding any error messages, version, and platform.

When using the FlightSqlClient.PreparedStatement flow, the client uses the original prepared statement handle when invoking ClosePreparedStatement, rather than the updated handle returned by the server when binding parameters.

Observed behavior

  • After preparing a statement, the server may return an updated handle in binding parameters call.
  • The client correctly uses the updated handle for Execute.
  • However, when calling ClosePreparedStatement, the client still uses the original handle stored in the final field preparedStatementResult.

Expected behavior

Based on my understanding of the protocol, once the server returns an updated handle, the client should consistently use that handle for all subsequent operations.

By specification on FlightSql.proto file:

  // Because the handle could potentially be updated, any previous handles for this prepared
  // statement should be considered invalid, and all subsequent requests for this prepared
  // statement must use this new handle.

Impact

In a custom server implementation I'm developing, this causes inconsistencies because:

  • the server expects the updated handle for all follow-up calls, including new put parameter calls and ClosePreparedStatement
  • ClosePreparedStatement fails or behaves unexpectedly when the original handle is used

Question / clarification

Is this the intended behavior according to the Flight SQL protocol, or is this a bug in the client implementation?

If this is expected, It's quite simple to adjust my server logic accordingly, but wanted to confirm that is not a bug on client implementation.

Metadata

Metadata

Assignees

Labels

Type: bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions