Skip to content

Conversation

@alinaliBQ
Copy link
Contributor

@alinaliBQ alinaliBQ commented Nov 3, 2025

Rationale for this change

Enable query execution in ODBC.

What changes are included in this PR?

  • Extract SQLExecDirect, SQLExecute, SQLPrepare implementation & tests

Are these changes tested?

  • Tested on local MSVC

Are there any user-facing changes?

N/A

@github-actions
Copy link

github-actions bot commented Nov 3, 2025

⚠️ GitHub issue #47711 has been automatically assigned in GitHub to PR creator.

Comment on lines +813 to +951
statement->Prepare(query);
statement->ExecutePrepared();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we implemented SQLExecDirect to use prepare/execute to use prepared statements to align with the behavior with JDBC

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Nov 3, 2025
@alinaliBQ alinaliBQ force-pushed the gh-47711-query-execution branch from 72e8db0 to 97c94b0 Compare November 3, 2025 20:42
ASSERT_EQ(SQL_SUCCESS,
SQLExecDirect(this->stmt, &sql0[0], static_cast<SQLINTEGER>(sql0.size())));

// GH-47713 TODO: Uncomment call to SQLFetch SQLGetData after implementation
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we weren't expecting these tests to pass yet? Are there build issues with this not commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When this PR is just created as draft, we aren't expecting them to pass. But once the pre-requisite ODBC API PRs get merged in main, I am expecting this PR to pass the CI tests after a rebase. And some calls to unimplemented API (SQLFetch and SQLGetData) are commented out because they will be enabled in a different PR

@alinaliBQ alinaliBQ changed the title GH-47711: [C++][FlightRPC] WIP: Enable ODBC query execution GH-47711: [C++][FlightRPC] Enable ODBC query execution Nov 10, 2025
return boost::make_optional(it != attribute_.end(), it->second);
}

boost::optional<std::shared_ptr<ResultSetMetadata>> FlightSqlStatement::Prepare(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Working on removing boost as part of #48067

@alinaliBQ
Copy link
Contributor Author

@lidavidm this draft PR is ready for review! Please have a look

@alinaliBQ alinaliBQ force-pushed the gh-47711-query-execution branch from 97c94b0 to 8625cfa Compare November 15, 2025 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants