forked from duckdb/duckdb-odbc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix conn string parsing with unsupported options
The ODBC specification does not mandate how the driver should deal with unsupported options specified by client in the connection string. When encountering an unsupported option, DuckDB driver registers a diagnostic message in a format: 'Invalid keyword: <option_name>', that can be fetched by client using SQLGetDiagRec function, and returns SQL_SUCCESS_WITH_INFO instead of SQL_SUCCESS. This is a reasonable approach, but there is inconsistent error handling in its implementation in Connect::ParseInputStr. It only checks for SQL_SUCCESS and treats SQL_SUCCESS_WITH_INFO as an error. This causes the early exit from this function that prevents subsequent options in the connection string to be processed. It also prevents the DSN name to be set on the connection (even when the DSN option comes before the unsupported one). To fix this it is proposed to check for both SQL_SUCCESS and SQL_SUCCESS_WITH_INFO and only do the early exit if some other error code is returned by FindKeyValPair routine. Testing: tests are included for a common option and for the DSN option. Fixes: duckdb#59
- Loading branch information
1 parent
d863d82
commit 2094239
Showing
3 changed files
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters