Skip to content

[Code Style] Move ifdefs for attributes outside of test cases - #62

Merged
alinaliBQ merged 5 commits into
apache-odbcfrom
fix-ifdef
Jul 10, 2025
Merged

[Code Style] Move ifdefs for attributes outside of test cases#62
alinaliBQ merged 5 commits into
apache-odbcfrom
fix-ifdef

Conversation

@alinaliBQ

@alinaliBQ alinaliBQ commented Jul 9, 2025

Copy link
Copy Markdown

Move #ifdef for attributes outside of test cases

@alinaliBQ alinaliBQ changed the title [Code Style] Move ifdefs outside of test cases [Code Style] Move ifdefs for attributes outside of test cases Jul 9, 2025
@alinaliBQ
alinaliBQ marked this pull request as ready for review July 9, 2025 18:41
Comment thread cpp/src/arrow/flight/sql/odbc/tests/connection_info_test.cc Outdated
Comment thread cpp/src/arrow/flight/sql/odbc/tests/connection_info_test.cc
Comment thread cpp/src/arrow/flight/sql/odbc/tests/connection_info_test.cc Outdated
Comment thread cpp/src/arrow/flight/sql/odbc/tests/connection_info_test.cc Outdated

@alinaliBQ alinaliBQ left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added 4 more items:

  • [odbc_api.cc] for consistency, put the log messages as the first line after API definitions
  • [entry_points.cc] replace statementHandle with stmt for consistency
  • [connection_info_test.cc] Use camel case for test names to be consistent with rest of arrow code
  • fix hstmt test case

Comment thread cpp/src/arrow/flight/sql/odbc/tests/connection_info_test.cc
Comment on lines 242 to 252
// These information types are implemented by the Driver Manager alone.
TYPED_TEST(FlightSQLODBCTestBase, Test_SQL_DRIVER_HSTMT) {
// TODO This is failing due to no statement being created
// This should run after SQLGetStmtAttr is implemented
GTEST_SKIP();
TYPED_TEST(FlightSQLODBCTestBase, TestSQLGetInfoDriverHstmt) {
this->connect();

validate(this->conn, SQL_DRIVER_HSTMT, static_cast<SQLULEN>(0));
// Value returned from driver manager is the stmt address
SQLHSTMT local_stmt = this->stmt;
SQLRETURN ret = SQLGetInfo(this->conn, SQL_DRIVER_HSTMT, &local_stmt, 0, 0);
EXPECT_EQ(ret, SQL_SUCCESS);
EXPECT_GT(local_stmt, static_cast<SQLHSTMT>(0));

this->disconnect();

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a test case fix here as well. I needed to call SQLGetInfo directly since SQL_DRIVER_HSTMT requires the input this->stmt according to the spec: https://learn.microsoft.com/en-us/sql/odbc/reference/syntax/sqlgetinfo-function?view=sql-server-ver17 cc @rscales

Comment thread cpp/src/arrow/flight/sql/odbc/tests/connection_info_test.cc Outdated
Comment thread cpp/src/arrow/flight/sql/odbc/tests/connection_info_test.cc Outdated
@alinaliBQ
alinaliBQ merged commit f75f458 into apache-odbc Jul 10, 2025
14 of 15 checks passed
@alinaliBQ
alinaliBQ deleted the fix-ifdef branch July 10, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants