ODBC: Truncation of string values follows ODBC standards

Details

Detail name Value
Changelog Number 13863
Type Improvement
Status Resolved
Fix Versions Exasol 8.0.0, Exasol 7.1.7
Resolution Date 2022-03-16

Background

For all Exasol ODBC data types, including datatypes with fixed size, like date, timestamp, decimal, double or boolean, the ODBC driver can return the values as strings. For this, a buffer has to be allocated and data be requested as string using SQLGetData, SQLFetch or SQLFetchScroll.

If the buffer is too small to contain all characters of the data converted to string, the zero termination is not added by the driver and the string length is set to the number of bytes in the string. This is not ODBC standard conform.

Improvement

For all data returned as string we now align to the ODBC standard specifications.

Details

When using SQLGetData, SQLFetch or SQLFetchScroll with a buffer smaller than the actual data, the data is truncated to the size of the buffer minus the size of the zero termination. The data is zero-terminated by the driver.
The string length returned is the length of the data available to return.
The functions SQLGetData, SQLFetch or SQLFetchScroll return SQL_SUCCESS_WITH_INFO and "01004" "String data, right truncated" for the truncated value.

Changed behavior

ODBC: Truncation of string values follows ODBC standards (SQLGetData, SQLFetch or SQLFetchScroll)