Skip to content

GH-55603: [C++][FlightRPC][ODBC] Fix Advanced Properties DSN table not saving known keys - #55869

Open
alinaliBQ wants to merge 3 commits into
apache:mainfrom
dremio:gh-55603-dsn-window-fix
Open

alinaliBQ wants to merge 3 commits into
apache:mainfrom
dremio:gh-55603-dsn-window-fix

Conversation

@alinaliBQ

@alinaliBQ alinaliBQ commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Rationale for this change

GH-55603

What changes are included in this PR?

  • Configuration::LoadDsn reads StringColumnLength, UseWideChar and
    ChunkBufferCapacity , and User_ID explicitly, before RemoveAllKnownKeys strips them.
  • [Windows] Add new FlightSqlConnection::DSN_DIALOG_KEYS to list the keys that have a dedicated
    field in the DSN dialog.
  • [Windows] Configuration::GetCustomKeys excludes DSN_DIALOG_KEYS instead of ALL_KEYS,
    so known keys without a dialog field appear in "Advanced properties" of DSN Window and are
    saved again.
  • [macOS] odbc_spi_impl_test now also links iODBC so the unit tests can call
    ODBC installer symbols.

Are these changes tested?

  • Yes, in CI and tested DSN Window GUI manually as well.

Are there any user-facing changes?

Yes, users will see the DSN UI window fixed.

Was AI used for this PR?

In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.

PR code and description written by:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

@alinaliBQ

Copy link
Copy Markdown
Collaborator Author

@lidavidm @kou This PR is ready for review, please have a look

@alinaliBQ
alinaliBQ requested a review from kou December 2, 2026 17:12
Comment on lines 175 to 190

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.

How about replacing the existing RemoveAllKnownKeys() and for (auto key : customKeys) loop in LoadDsn() with the following instead of reading StringColumnLength, UseWideChar, ChunkBufferCapacity and User ID explicitly?

Suggested change
for (const auto& key : customKeys) {
if (arrow::internal::AsciiEqualsCaseInsensitive(key, FlightSqlConnection::DSN) ||
arrow::internal::AsciiEqualsCaseInsensitive(key, FlightSqlConnection::DRIVER)) {
continue;
}
Emplace(key, ReadDsnString(dsn, key));
}

Emplace() doesn't overwrite the keys that are read explicitly. PropertyMap is case-insensitive.

With this approach, we don't need to update LoadDsn() when we add a new key to ALL_KEYS. We also don't need the LoadDsnReadsAllKnownKeys test.

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.

applied suggestion

Self-review connection_test.cc

-  Simplify TestSQLDriverConnectStringColumnLength
- Drop DsnSurvivesDialogRoundTrip

Self-review and update comments
@alinaliBQ
alinaliBQ force-pushed the gh-55603-dsn-window-fix branch from 3ddd50d to 6e7eb52 Compare December 3, 2026 17:59
- USER_ID doesn't have a DSN field
- Remove `RemoveAllKnownKeys`

Co-Authored-By: Sutou Kouhei <kou@clear-code.com>
@alinaliBQ
alinaliBQ force-pushed the gh-55603-dsn-window-fix branch from dbb5563 to ebc5f1f Compare December 3, 2026 19:59

@alinaliBQ alinaliBQ left a comment

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.

@kou I have addressed comments

Comment on lines 175 to 190

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.

applied suggestion

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] Add custom known field on ODBC Windows DSN window doesn't work properly

3 participants