fix(Data): Refactor ODBC tests and fix testReconnect TypeInfo caching…#5140
Merged
fix(Data): Refactor ODBC tests and fix testReconnect TypeInfo caching…#5140
Conversation
…5136 - Add TypeInfo::reset() to clear cached type info, called on session close to fix testReconnect failing when connection is reestablished - Move common test methods from ODBC SQLExecutor to shared DataTest SQLExecutor for better code reuse across database backends - Improve error message in hasTransactionIsolation() to be more descriptive - Refactor ODBC MySQL and PostgreSQL test executors to delegate to shared base implementation - Update MySQL, PostgreSQL, and SQLite test suites to use refactored executor methods - Add Nix shell environments for MySQL and PostgreSQL test databases with auto-start/stop and ODBC driver configuration
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request refactors the ODBC test infrastructure to improve code reuse and fixes a critical TypeInfo caching bug that prevented testReconnect from passing. The changes consolidate duplicate test code across database backends into a shared DataTest::SQLExecutor implementation and enhance test environment setup with Nix shell configurations.
Key Changes:
- Fixed TypeInfo caching bug by adding reset() method called on session close
- Moved stdOptional and stdTupleWithOptional test implementations from database-specific code to shared DataTest::SQLExecutor
- Enhanced ODBC driver discovery for MySQL and PostgreSQL with fallback driver lists for better portability
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Foundation/src/FastLogger.cpp | Adds nested preprocessor guards to restrict CPU affinity code to Linux and Windows platforms |
| Data/ODBC/src/TypeInfo.cpp | Implements reset() method to clear cached type info |
| Data/ODBC/src/SessionImpl.cpp | Calls TypeInfo::reset() on session close to fix reconnection issues; improves error messages |
| Data/ODBC/include/Poco/Data/ODBC/TypeInfo.h | Declares reset() method with documentation |
| Data/ODBC/include/Poco/Data/ODBC/SessionImpl.h | Improves error message for read-only property access |
| Data/ODBC/testsuite/src/SQLExecutor.h | Adds stdOptional and stdTupleWithOptional delegating methods; fixes filter() signature |
| Data/ODBC/testsuite/src/SQLExecutor.cpp | Updates executor name handling and adds tolerance for timestamp second rounding differences |
| Data/ODBC/testsuite/src/ODBCTest.h | Adds testStdOptional, testStdTupleWithOptional methods and recreateNullableStringTable |
| Data/ODBC/testsuite/src/ODBCTest.cpp | Implements new test methods and adds quiet parameter for driver discovery |
| Data/ODBC/testsuite/src/ODBCPostgreSQLTest.h | Adds recreateNullableStringTable override |
| Data/ODBC/testsuite/src/ODBCPostgreSQLTest.cpp | Implements driver fallback list, fixes error messages, adds new optional tests |
| Data/ODBC/testsuite/src/ODBCMySQLTest.h | Adds recreateNullableStringTable override |
| Data/ODBC/testsuite/src/ODBCMySQLTest.cpp | Implements driver fallback list, fixes error messages, adds new optional tests, comments out bulk tests |
| Data/PostgreSQL/testsuite/src/SQLExecutor.h | Adds stdOptional and stdTupleWithOptional methods |
| Data/PostgreSQL/testsuite/src/SQLExecutor.cpp | Implements delegation to shared DataTest executor |
| Data/PostgreSQL/testsuite/src/PostgreSQLTest.cpp | Refactors to use shared test implementations; adds GCC diagnostic pragmas for false positive warnings |
| Data/PostgreSQL/shell.nix | Adds Nix shell environment for PostgreSQL test database setup |
| Data/PostgreSQL/.gitignore | Ignores Nix shell data directory |
| Data/MySQL/testsuite/src/SQLExecutor.h | Adds stdOptional and stdTupleWithOptional methods and _dataExecutor member |
| Data/MySQL/testsuite/src/SQLExecutor.cpp | Implements delegation to shared DataTest executor |
| Data/MySQL/testsuite/src/MySQLTest.cpp | Refactors to use shared test implementations |
| Data/MySQL/testsuite/Makefile | Adds PocoDataTest library dependency |
| Data/MySQL/shell.nix | Adds Nix shell environment for MySQL test database setup |
| Data/MySQL/.gitignore | Ignores Nix shell data directory |
| Data/SQLite/testsuite/src/SQLiteTest.cpp | Removes testStdTuple from test suite registration; adds blank lines for formatting |
| Data/DataTest/src/SQLExecutor.cpp | Adds stdOptional and stdTupleWithOptional implementations with error handling; improves transaction isolation code formatting |
| Data/DataTest/include/Poco/Data/Test/SQLExecutor.h | Declares stdOptional and stdTupleWithOptional methods |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
matejk
approved these changes
Dec 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… #5136