-
Notifications
You must be signed in to change notification settings - Fork 3
impl(bq_driver): Add impl for SQL_ATTR_ANSI_APP attribute #1637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,11 @@ void SetAttributes(std::shared_ptr<ODBCHandles> const& conn, int timeout, | |
| status = SQLSetConnectAttrA(conn->hdbc, SQL_ATTR_CONNECTION_TIMEOUT, | ||
| ToSqlPointer(timeout), 0); | ||
| CheckError(status, "SQLSetConnectAttr", conn, use_ansi); | ||
| #ifndef WIN32 | ||
| status = SQLSetConnectAttrA(conn->hdbc, SQL_ATTR_ANSI_APP, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's verify if driver manager is allowed to dynamically change the bahaviour by setting
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added attribute value change after connection creation, driver has same behavior as Simba BQ driver and also same same behavior as official doc.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see where we are setting the attribute after making the connection. |
||
| ToSqlPointer(SQL_AA_TRUE), 0); | ||
| CheckError(status, "SQLSetConnectAttr", conn, use_ansi); | ||
| #endif // WIN32 | ||
| } else { | ||
| status = SQLSetConnectAttr(conn->hdbc, SQL_ATTR_LOGIN_TIMEOUT, | ||
| ToSqlPointer(10), 0); | ||
|
|
@@ -44,12 +49,17 @@ void SetAttributes(std::shared_ptr<ODBCHandles> const& conn, int timeout, | |
| status = SQLSetConnectAttr(conn->hdbc, SQL_ATTR_CONNECTION_TIMEOUT, | ||
| ToSqlPointer(timeout), 0); | ||
| CheckError(status, "SQLSetConnectAttr", conn, use_ansi); | ||
| #ifndef WIN32 | ||
| status = SQLSetConnectAttr(conn->hdbc, SQL_ATTR_ANSI_APP, | ||
| ToSqlPointer(SQL_AA_FALSE), 0); | ||
| CheckError(status, "SQLSetConnectAttr", conn, use_ansi); | ||
| #endif // WIN32 | ||
| } | ||
| } | ||
|
|
||
| SQLRETURN Connect(std::string const& conn_str, | ||
| std::shared_ptr<ODBCHandles> const& conn, int timeout, | ||
| bool use_ansi) { | ||
| std::shared_ptr<ODBCHandles> const& conn, bool use_ansi, | ||
| int timeout) { | ||
| SQLSMALLINT buflen; | ||
| SQLCHAR data_source[kBufferLength]; | ||
| SQLSMALLINT out_len; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see how to write test case for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
existing test cases will be utilsied