Skip to content

GH-49482: [C++][FlightRPC][ODBC] Fix inconsistent SQLGetInfo values in global connection#50021

Open
vanshaj2023 wants to merge 1 commit into
apache:mainfrom
vanshaj2023:fix/GH-49482-fix-sqlgetinfo-inconsistent-values
Open

GH-49482: [C++][FlightRPC][ODBC] Fix inconsistent SQLGetInfo values in global connection#50021
vanshaj2023 wants to merge 1 commit into
apache:mainfrom
vanshaj2023:fix/GH-49482-fix-sqlgetinfo-inconsistent-values

Conversation

@vanshaj2023
Copy link
Copy Markdown
Contributor

@vanshaj2023 vanshaj2023 commented May 22, 2026

What changed

  • SQL_DDL_SCHEMA case now reads the boolean scalar to conditionally set SQL_DROP_SCHEMA and SQL_CREATE_SCHEMA to 0 when unsupported, instead of always writing non-zero values
  • SQL_DDL_TABLE case applies the same pattern for SQL_DROP_TABLE and SQL_CREATE_TABLE
  • SQL_CATALOG_AT_START changed to use SetDefaultIfMissing so it does not overwrite SQL_CATALOG_LOCATION already set by ARROW_SQL_CATALOG_TERM, eliminating an ordering-dependent conflict
  • Removed per-test connect/disconnect workarounds and converted three tests from ConnectionInfoHandleTest back to ConnectionInfoTest

How to test

  • Build ODBC tests and run TestSQLGetInfoCatalogLocation, TestSQLGetInfoDropSchema, TestSQLGetInfoDropTable with both mock server and global connection fixture
  • All three tests should pass consistently regardless of connection reuse

Closes #49482

Copy link
Copy Markdown
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Also CC @alinaliBQ

Comment on lines +398 to +399
bool supported =
reinterpret_cast<BooleanScalar*>(scalar->child_value().get())->value;
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.

Maybe we can use checked_cast from arrow/util/checked_cast.h?

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.

It seems there's some failing tests - some more test cases need updating?

@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels May 25, 2026
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.

[C++][FlightRPC][ODBC] Fix inconsistent values in SQLGetInfo in global connection

2 participants