kou commented on PR #946:
URL: https://github.com/apache/arrow-adbc/pull/946#issuecomment-1656375618
How about adding a new member instead of recycling `vendor_code`?
```c
struct ADBC_EXPORT AdbcError {
/// \brief The error message.
char* message;
/// \brief A vendor-specific error code, if applicable.
int32_t vendor_code;
/// \brief A SQLSTATE error code, if provided, as defined by the
/// SQL:2003 standard. If not set, it should be set to
/// "\0\0\0\0\0".
char sqlstate[5];
/// \brief Release the contained error.
///
/// Unlike other structures, this is an embedded callback to make it
/// easier for the driver manager and driver to cooperate.
void (*release)(struct AdbcError* error);
/// \brief Driver-specific state.
void* private_data;
};
```
We use a special `vendor_code` value such as `#define
ADBC_ERROR_VENDOR_CODE_USE_PRIVATE_DATA INT32_MIN` to detect whether the
`AdbcError` uses `private_data` or not. It has a small API (not ABI)
incompatibility (users can't use the special `vendor_code` value) but it'll not
be a real problem by choosing a good special value.
--
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]