Repository navigation
fix: Detect MariaDB Connector/C by its macros, not by version number - #628
Conversation
…ient 26.x MySQL moved to calendar versioning, so client 26.10 reports a MYSQL_VERSION_ID around 261000. The range check `MYSQL_VERSION_ID >= 80000 && MYSQL_VERSION_ID < 100000` then treated it like MariaDB, leaving `my_bool` undefined and using the removed `MYSQL_OPT_SSL_ENFORCE`. `src/pch.h` now defines `RMARIADB_MARIADB_CLIENT` from `LIBMARIADB`, `MARIADB_PACKAGE_VERSION_ID` or `MARIADB_BASE_VERSION`, which only MariaDB's headers define, and `RMARIADB_MYSQL_8_OR_LATER` for any other client with MYSQL_VERSION_ID >= 80000. `src/DbConnection.cpp` uses the latter for the SSL mode branches. The `>= 50700` checks are unchanged, since they hold for every supported client. Closes #626 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd7atAZVq1J42WzXJpS
|
Real MySQL 26.x verification: run 46262859813 on the temporary branch Generated by Claude Code |
|
Result of run 46262859813, macOS The clean review found nothing above Low. Marking this ready for review. Generated by Claude Code |
Closes #626.
src/pch.handsrc/DbConnection.cpptold MySQL ≥ 8 apart from MariaDB Connector/C withMYSQL_VERSION_ID >= 80000 && MYSQL_VERSION_ID < 100000. MySQL's calendar-versioned 26.x client reports about 261000, so the build failed withmy_boolundeclared andMYSQL_OPT_SSL_ENFORCEunknown.What changes:
src/pch.hdetects MariaDB Connector/C by its own macros (LIBMARIADB,MARIADB_PACKAGE_VERSION_ID,MARIADB_BASE_VERSION). libmariadb-dev 10.11 defines these, and MySQL 8.0 headers define none of them.RMARIADB_MYSQL_8_OR_LATER, meaning not MariaDB andMYSQL_VERSION_ID >= 80000. Themy_boolshim and both SSL-mode branches insrc/DbConnection.cppuse it.>= 50700checks hold for every supported client and are unchanged.configureandtools/contain no version logic.Verification:
-fsyntax-onlycompiles of allsrc/*.cpp, onmainand with this fix:MYSQL_VERSION_IDset to 261000:mainreproduces the errors from Build fails against MySQL client 26.x: version check mistakes it for MariaDB Connector/C #626, the fix is clean.mysql_configjob. That job uses the MySQL client only with ci: Pass MySQL matrix flags to the custom actions viaenv#597. A matrix run on a temporary branch merging this PR with ci: Pass MySQL matrix flags to the custom actions viaenv#597 is linked in the comments.https://claude.ai/code/session_01Hr1rd7atAZVq1J42WzXJpS
Generated by Claude Code