hcrosse opened a new pull request, #1736: URL: https://github.com/apache/arrow-go/pull/1736
### Rationale for this change In the FlightSQL SQLite example server, prepared statement parameter extraction releases each scalar returned by `scalar.GetScalar` before converting it. For binary scalars, releasing first clears the underlying slice buffer so the extracted parameter becomes empty. Even when conversion runs before release, `scalarToIFace` returns a byte slice aliasing the Arrow buffer, which becomes invalid once the record batch and reader are released before query execution. ### What changes are included in this PR? - Convert each scalar in `getParamsForStatement` before releasing it, while still releasing on conversion errors. - Clone binary scalar bytes in `scalarToIFace` with `bytes.Clone` so stored prepared statement parameters do not alias Arrow buffers. ### Are these changes tested? Yes. I added a unit test using a checked allocator that poisons freed memory to verify int64, string, binary, and null parameters remain intact after the reader and record batch are released, with zero leaked bytes. ### Are there any user-facing changes? Binary prepared statement parameters in the FlightSQL SQLite example server are no longer cleared or corrupted by premature scalar and batch release. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
