Skip to content

fix(Data): Refactor ODBC tests and fix testReconnect TypeInfo caching…#5140

Merged
aleks-f merged 6 commits intomainfrom
5136-data-tests
Dec 24, 2025
Merged

fix(Data): Refactor ODBC tests and fix testReconnect TypeInfo caching…#5140
aleks-f merged 6 commits intomainfrom
5136-data-tests

Conversation

@aleks-f
Copy link
Copy Markdown
Member

@aleks-f aleks-f commented Dec 24, 2025

#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

…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
@aleks-f aleks-f added this to the Release 1.15.0 milestone Dec 24, 2025
@aleks-f aleks-f self-assigned this Dec 24, 2025
@aleks-f aleks-f requested a review from Copilot December 24, 2025 05:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@aleks-f aleks-f requested review from frwilckens and matejk December 24, 2025 07:07
@aleks-f aleks-f merged commit 0e1ba0b into main Dec 24, 2025
90 checks passed
@aleks-f aleks-f deleted the 5136-data-tests branch December 24, 2025 13:42
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.

3 participants