HyukjinKwon opened a new pull request, #48708:
URL: https://github.com/apache/arrow/pull/48708

    ### Rationale for this change
   
   
https://github.com/apache/arrow/blob/8fc54a35f7df672d416ebd12a9558d320fba9afe/cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_statement.cc#L746-L748
   
   This was introduced by 
https://github.com/apache/arrow/commit/ed36107ad869dd0db5c33a7c3e5484f66a461a4f
   
   The `GetData` function was using hardcoded precision (38) and scale (0) 
values instead of retrieving them from the IRD (Implementation Row Descriptor). 
This fix ensures that precision/scale are properly retrieved from the IRD as 
defaults, and can be overridden by ARD (Application Row Descriptor) values when 
specified, following ODBC specification behavior.
   
   ### What changes are included in this PR?
   
   - Modified `ODBCStatement::GetData()` to use IRD precision/scale as defaults 
instead of hardcoded values
   - ARD precision/scale now properly override IRD values when `SQL_ARD_TYPE` 
or `SQL_C_DEFAULT` is used
   - Added unit tests to verify IRD defaults and ARD override behavior
   
   ### Are these changes tested?
   
   Yes. Added two comprehensive tests in `statement_test.cc`:
   - `TestGetDataPrecisionScaleUsesIRDAsDefault`: Verifies IRD precision/scale 
are used as defaults
   - `TestGetDataPrecisionScaleUsesARDWhenSet`: Verifies ARD precision/scale 
override IRD when set
   
   ### Are there any user-facing changes?
   
   I think it's fair to say a no. This is an internal fix that ensures correct 
ODBC behavior.
   
   


-- 
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]

Reply via email to