Skip to content

fix: Detect MariaDB Connector/C by its macros, not by version number - #628

Merged
krlmlr merged 1 commit into
mainfrom
claude/mysql-26-client
Nov 29, 2026
Merged

krlmlr merged 1 commit into
mainfrom
claude/mysql-26-client

Conversation

@krlmlr

@krlmlr krlmlr commented Nov 29, 2026

Copy link
Copy Markdown
Member

Closes #626.

src/pch.h and src/DbConnection.cpp told MySQL ≥ 8 apart from MariaDB Connector/C with MYSQL_VERSION_ID >= 80000 && MYSQL_VERSION_ID < 100000. MySQL's calendar-versioned 26.x client reports about 261000, so the build failed with my_bool undeclared and MYSQL_OPT_SSL_ENFORCE unknown.

What changes:

  • src/pch.h detects 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.
  • It defines RMARIADB_MYSQL_8_OR_LATER, meaning not MariaDB and MYSQL_VERSION_ID >= 80000. The my_bool shim and both SSL-mode branches in src/DbConnection.cpp use it.
  • The >= 50700 checks hold for every supported client and are unchanged. configure and tools/ contain no version logic.

Verification:

https://claude.ai/code/session_01Hr1rd7atAZVq1J42WzXJpS


Generated by Claude Code

…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

krlmlr commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

Real MySQL 26.x verification: run 46262859813 on the temporary branch claude/ci-mysql-26-check, which merges this PR with #597, so the macOS mysql_config job builds against Homebrew's mysql-client 26.10.0. The branch exists only for this check and is not meant to be merged.


Generated by Claude Code

krlmlr commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

Result of run 46262859813, macOS mysql_config job (#597 merged with this PR, Homebrew mysql-client 26.10.0): every source file compiles, and the my_bool / MYSQL_OPT_SSL_ENFORCE errors from #626 are gone. The job then fails at link time with ld: library 'zstd' not found. mysql_config --libs lists -lzstd without a -L for Homebrew's zstd. That belongs to the CI setup of that job and is being fixed in #597, not here.

The clean review found nothing above Low. Marking this ready for review.


Generated by Claude Code

@krlmlr
krlmlr marked this pull request as ready for review November 29, 2026 12:52
@krlmlr
krlmlr merged commit 7a6aa9e into main Nov 29, 2026
9 checks passed
@krlmlr
krlmlr deleted the claude/mysql-26-client branch November 29, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build fails against MySQL client 26.x: version check mistakes it for MariaDB Connector/C

2 participants