Commit Graph
1 Commits
Author SHA1 Message Date
Claude 607877a6e5 port: ODBC through the system's driver manager
The ODBC functions MFC calls were stubs on Linux and macOS. They now go
to unixODBC or iODBC, loaded with dlopen the first time a program uses
ODBC (WINPORT_ODBC names the library when it is somewhere else).

The layer calls only the driver manager's ANSI functions, in UTF-8, so
the manager's own wide type never matters. The wide functions convert
their strings. Wide data is read and bound as UTF-8 text: SQLGetData
reads a column's value once and hands it out in the pieces asked for,
and a wide parameter gets a UTF-8 copy that is refreshed before each
execution and copied back afterward for output parameters. SQLFreeStmt
is there too. The definitions are weak, so dbtest's in-memory driver
still takes their place.

The new odbctest runs CDatabase, CRecordset and the wide API against
SQLite 3 through unixODBC, with non-ASCII text. CI installs unixODBC and
the SQLite driver on Linux (and on macOS through Homebrew). Without
them the test notes that and passes, unless MFC_TEST_ODBC=1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
2026-11-19 01:32:16 +00:00