Skip to content

GH-47713: [C++][FlightRPC] ODBC return number of affected rows - #48037

Merged
lidavidm merged 1 commit into
apache:mainfrom
Bit-Quill:gh-47713-sql-row-count
Dec 8, 2025
Merged

lidavidm merged 1 commit into
apache:mainfrom
Bit-Quill:gh-47713-sql-row-count

Conversation

@alinaliBQ

@alinaliBQ alinaliBQ commented Nov 3, 2025 •

Copy link
Copy Markdown
Collaborator

Rationale for this change

Make ODBC return number of affected rows as -1 which to BI tools means number of affected rows is unknown. This is because ODBC only supports select statement and doesn't support queries that affect rows.

What changes are included in this PR?

  • SQLRowCount & tests

Are these changes tested?

Tested locally on MSVC

Are there any user-facing changes?

N/A

@alinaliBQ
alinaliBQ force-pushed the gh-47713-sql-row-count branch from 4fcdc67 to 2120315 Compare November 10, 2025 19:43
@alinaliBQ alinaliBQ changed the title GH-47713: [C++][FlightRPC] WIP: ODBC return number of affected rows GH-47713: [C++][FlightRPC] ODBC return number of affected rows Nov 10, 2025
@alinaliBQ

Copy link
Copy Markdown
Collaborator Author

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

CheckStringColumnW(this->stmt, 2, L"One");
CheckIntColumn(this->stmt, 3, 3);

ASSERT_EQ(SQL_SUCCESS, SQLRowCount(this->stmt, 0));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit, but can we write nullptr for nullptr and not use 0?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yup, fixed

Update doc

Co-Authored-By: alinalibq <alina.li@improving.com>
@alinaliBQ
alinaliBQ force-pushed the gh-47713-sql-row-count branch from b22c359 to aed5b0e Compare December 6, 2025 00:24
@alinaliBQ
alinaliBQ marked this pull request as ready for review December 6, 2025 00:24
@lidavidm
lidavidm merged commit 082377a into apache:main Dec 8, 2025
@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit 082377a.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 5 possible false positives for unstable benchmarks that are known to sometimes produce them.

Mottl pushed a commit to Mottl/arrow that referenced this pull request May 26, 2026
…pache#48037)

### Rationale for this change
Make ODBC return number of affected rows as -1 which to BI tools means number of affected rows is unknown. This is because ODBC only supports `select` statement and doesn't support queries that affect rows.

### What changes are included in this PR?
- SQLRowCount & tests

### Are these changes tested?
Tested locally on MSVC

### Are there any user-facing changes?

N/A

* GitHub Issue: apache#47713

Authored-by: Alina (Xi) Li <alina.li@improving.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
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