Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_statement.cc
Original file line number Diff line number Diff line change
Expand Up @@ -784,11 +784,7 @@ SQLRETURN ODBCStatement::GetData(SQLSMALLINT record_number, SQLSMALLINT c_type,

@alinaliBQ alinaliBQ Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The CI hasn't run the C++ Extra tests, so I'm not sure whether TestSQLMoreResultsWithoutQuery will fail. If the driver manager doesn't return HY010 for SQLMoreResults, you may need to update TestSQLMoreResultsWithoutQuery to expect SQL_NO_DATA on all platforms.

TYPED_TEST(StatementTest, TestSQLMoreResultsWithoutQuery) {
#ifdef __linux__
ASSERT_EQ(SQL_NO_DATA, SQLMoreResults(this->stmt));
#else // Windows & Mac
// Verify function sequence error state is reported when SQLMoreResults is called
// without executing any queries
ASSERT_EQ(SQL_ERROR, SQLMoreResults(this->stmt));
VerifyOdbcErrorState(SQL_HANDLE_STMT, this->stmt, kErrorStateHY010);
#endif
}

to:

TYPED_TEST(StatementTest, TestSQLMoreResultsWithoutQuery) {
  ASSERT_EQ(SQL_NO_DATA, SQLMoreResults(this->stmt));
}

edit: fixed typo

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch. I pushed without the test fix to verify the test fails in CI since I don't have the tests running locally.

SQLRETURN ODBCStatement::GetMoreResults() {
// Multiple result sets are not supported by Arrow protocol.
if (current_result_) {
return SQL_NO_DATA;
} else {
throw DriverException("Function sequence error", "HY010");
}
return SQL_NO_DATA;
}

void ODBCStatement::GetColumnCount(SQLSMALLINT* column_count_ptr) {
Expand Down
7 changes: 0 additions & 7 deletions cpp/src/arrow/flight/sql/odbc/tests/statement_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1984,14 +1984,7 @@ TYPED_TEST(StatementTest, TestSQLMoreResultsNoData) {
}

TYPED_TEST(StatementTest, TestSQLMoreResultsWithoutQuery) {
#ifdef __linux__
ASSERT_EQ(SQL_NO_DATA, SQLMoreResults(this->stmt));
#else // Windows & Mac
// Verify function sequence error state is reported when SQLMoreResults is called
// without executing any queries
ASSERT_EQ(SQL_ERROR, SQLMoreResults(this->stmt));
VerifyOdbcErrorState(SQL_HANDLE_STMT, this->stmt, kErrorStateHY010);
#endif
}

TYPED_TEST(StatementTest, TestSQLNativeSqlReturnsInputString) {
Expand Down
Loading