Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
column.getData needs to set c.len to the "total" buffer size. Otherwise, we will return truncated data. SQLGetData sets c.len to the number of bytes that are copied to the output buffer. That's correct if the output buffer is big enough and the output data isn't truncated. If the data is truncated, we call SQLGetData in a loop until we get all the data. Each call to SQLGetData sets c.len to the number of bytes fetched. In the end, c.len is not the total number of bytes fetched. Instead, it is the amount of bytes fetched during the last call to SQLGetData. When we return the data to the application, we only return up to c.len. Since c.len is not the total size, the returned data is truncated. Fix it by setting c.len to the total number of bytes fetched before returning from column.getData(...).
- Loading branch information