Closed jgoizueta closed 3 years ago
I looked into the Simba driver documentation and found no reference to 01000, but I need to check if there's some additional documentation
Maybe it's better to restore the string truncation detection we had before #131 where in the case of SQLGetData returning SQL_SUCCESS_WITH_INFO and the SQLState being different from 01S07 (fractional truncation) we interpret it as string truncation.
Hey, I'm going to merge this to test a new release package and fix this ASAP, but I still welcome CR about this, for awareness and discussing this problem.
See https://app.clubhouse.io/cartoteam/story/116537
We've found a case where when reading a text field containing 178665 chars (a BigQuery Geography in WKT form), the text was being truncated to 8192 characters (MAXIMUM_BUFFER_SIZE, the chunk size in this case) because after the SQLGetData call, which was returning SQL_SUCCESS_WITH_INFO, the SQLState obtained with SQLGetDiagRec was "01000". The value used by all drivers we've been using for string truncation is "01004", but MS Docs say drivers can do whatever they wish:
🤦
Note that according to SQLGetData documentation 01000 is a General Warning ("Driver-specific informational message").
In the case found it seems clear that the meaning is string truncation and the full string is read if we interpret it so. So this will interpret both the usual 01004 and 01000 as string truncation. It seems unlikely that we find a driver which uses 01000 with other meaning here 🤞