Skip to content

Bump mariadb-connector-c from 3.1.29 to 3.4.9 - #108328

Merged
thevar1able merged 6 commits into
masterfrom
bump-mariadb-connector-c-3.4.9
Jun 29, 2026
Merged

thevar1able merged 6 commits into
masterfrom
bump-mariadb-connector-c-3.4.9

Conversation

@thevar1able

@thevar1able thevar1able commented Jun 23, 2026 •

Copy link
Copy Markdown
Member

Bump the mariadb-connector-c submodule from the fork's 3.1.29 branch to a new ClickHouse/v3.4.9 branch built on upstream v3.4.9.

The fork's 3.1.29 branch carried nine ClickHouse patches on top of upstream v3.1.29. They were triaged for v3.4.9:

Kept (re-ported onto v3.4.9, original authorship preserved):

  • Make global vars atomic and Strange fix for _Atomic in g++
  • Remove dependency on "services" database — drop getservbyname (/etc/services lookup) and the MYSQL_TCP_PORT env override; always use MARIADB_PORT
  • Fix calling wait_io_or_timeout() — on the TLS write paths (SSL_ERROR_WANT_WRITE in ma_tls_connect and ma_tls_write) pass is_read=FALSE so we wait for the socket to become writable rather than readable; otherwise the 5 ms poll times out and breaks the loop, failing the write prematurely

Dropped (now redundant):

  • Port to BoringSSL — ClickHouse links real OpenSSL (which provides EVP_ripemd160), and upstream v3.4.9 already removed the MA_HASH_RIPEMD160 case from openssl_crypt.c
  • Fix usage of wait_io_or_timeout from TLS layers (timeout units) — upstream rewrote these call sites to use a fixed 5 ms poll-and-retry loop, which supersedes it
  • rm zlib — upstream removed bundled zlib by v3.4.9
  • cleaning duplicate linker flags and fixed SEARCH_LIBRARY — they touch upstream CMake files that ClickHouse deletes and replaces with its own contrib/mariadb-connector-c-cmake/

Build integration (contrib/mariadb-connector-c-cmake/CMakeLists.txt):

  • drop ma_sha1.c (removed upstream; hashing now comes from the already-built openssl_crypt.c) and add the new ma_decimal.c
  • drop the aurora connection plugin (plugins/connection/aurora.c was removed upstream)

Verified locally by building lib_mariadbclient.a and the mysqlxx consumer.

The fork branch is at https://github.com/ClickHouse/mariadb-connector-c/tree/ClickHouse/v3.4.9

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Updated mariadb-connector-c to 3.4.9.

Version info

  • Merged into: 26.7.1.264 (included in 26.7 and later)

Update the `contrib/mariadb-connector-c` submodule from the fork's
`3.1.29` branch (upstream `v3.4.9` was three minor versions ahead) to a
new `ClickHouse/v3.4.9` branch built on top of upstream `v3.4.9`.

The fork's `3.1.29` branch carried nine ClickHouse patches on top of
upstream `v3.1.29`. They were triaged for `v3.4.9`:

Kept (re-ported, original authorship preserved):
- `Make global vars atomic` and `Strange fix for _Atomic in g++`
- `Remove dependency on "services" database` (drop `getservbyname` /
  `MYSQL_TCP_PORT`, always use `MARIADB_PORT`)
- `Fix calling wait_io_or_timeout()` (pass `is_read=FALSE` on the write
  paths so we wait for writability, not readability)

Dropped (now redundant):
- `Port to BoringSSL`: ClickHouse links real OpenSSL (which provides
  `EVP_ripemd160`), and upstream `v3.4.9` already removed the
  `MA_HASH_RIPEMD160` case from `openssl_crypt.c`.
- `Fix usage of wait_io_or_timeout from TLS layers` (timeout units):
  upstream rewrote these call sites to use a fixed 5 ms poll-and-retry
  loop, which supersedes it.
- `rm zlib`: upstream removed bundled `zlib` by `v3.4.9`.
- `cleaning duplicate linker flags` and `fixed SEARCH_LIBRARY`: they
  touch upstream CMake files that ClickHouse deletes and replaces with
  its own `contrib/mariadb-connector-c-cmake/`.

CMake build integration (`contrib/mariadb-connector-c-cmake/CMakeLists.txt`):
- drop `ma_sha1.c` (removed upstream; hashing comes from the already-built
  `openssl_crypt.c`) and add the new `ma_decimal.c`
- drop the `aurora` connection plugin (`plugins/connection/aurora.c` was
  removed upstream)

Verified by building `lib_mariadbclient.a` and the `mysqlxx` consumer.
@clickhouse-gh

clickhouse-gh Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [98b2065]

Summary: ❌

job_name test_name status info comment
Stress test (amd_msan) FAIL
Logical error: Bad cast from type A to B (STID: 4054-600e) FAIL cidb, issue ISSUE EXISTS

AI Review

Summary

This PR bumps mariadb-connector-c from 3.1.29 to 3.4.9, updates the ClickHouse CMake shim for the new connector sources/version metadata, registers the static zlib compression plugin needed by MYSQL_OPT_COMPRESS, and updates one MySQL dictionary test assertion for the connector's new connection-error wording. I checked the current diff, prior review threads, the latest CI report, and the relevant connector TLS/compression integration paths; I did not find a current blocker or major issue.

Final Verdict

✅ No findings to post as inline review comments.

@thevar1able
thevar1able marked this pull request as ready for review June 23, 2026 20:28
@clickhouse-gh clickhouse-gh Bot added pr-build Pull request with build/testing/packaging improvement submodule changed At least one submodule changed in this PR. labels Jun 23, 2026
Comment thread contrib/mariadb-connector-c Resolved
thevar1able and others added 5 commits June 23, 2026 22:42
Address review on the 3.4.9 bump:

- Since connector 3.4 the zlib protocol compression (CLIENT_COMPRESS)
  moved behind a client compression plugin. ClickHouse enables it via
  mysql_options(MYSQL_OPT_COMPRESS) (mysqlxx Connection, when
  enable_compression is set), so without a registered COMPRESSION plugin
  compression_plugin(net) stays null and mysql_real_connect fails with
  CR_ERR_LOAD_PLUGIN. Register plugins/compress/c_zlib.c as a static
  builtin plugin (matching upstream plugins/compress/CMakeLists.txt)
  before ma_client_plugin.c is configured.

- Bump CPACK_PACKAGE_VERSION from 3.1.29 to 3.4.9 so the generated
  MARIADB_PACKAGE_VERSION (used by mysql_get_client_info,
  mysql_get_client_version and the _client_version connect attribute)
  reports the correct connector version.
CI on the 3.4.9 bump showed flaky "TLS/SSL error: Connection timed out
(110)" failures across all MySQL tests (02479_mysql_connect_to_self,
02680_mysql_ast_logical_err, 02833_concurrent_sessions, test_storage_mysql,
test_dictionaries_mysql). Root cause: upstream v3.4.9 rewrote the TLS
wait_io_or_timeout() call sites to use a hardcoded 5 ms timeout; since the
handshake socket is non-blocking, that 5 ms poll is the only timeout
governing it, so under sanitizer load the handshake aborts spuriously.

Point at the fork commit that restores using the connection's configured
timeouts (pvio->timeout[...], in ms) for the TLS connect/read/write polls.

CI report: #108328
test_background_dictionary_reconnect asserted on the connector's host-error
text "Can't connect to MySQL server on ...". mariadb-connector-c 3.4.x
dropped "MySQL" from this message (errno 2003 is now "Can't connect to
server on '%-.64s' (%d)"), so the LIKE pattern matched 0 rows. Update the
pattern to the new wording. The reconnect logic itself is unaffected (the
other two assertions in the test pass).

CI report: #108328
@thevar1able
thevar1able requested a review from rschu1ze June 25, 2026 14:13
@evillique evillique self-assigned this Jun 29, 2026
@thevar1able
thevar1able added this pull request to the merge queue Jun 29, 2026
Merged via the queue into master with commit 0a567fc Jun 29, 2026
165 of 167 checks passed
@thevar1able
thevar1able deleted the bump-mariadb-connector-c-3.4.9 branch June 29, 2026 20:40
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 29, 2026
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
CI on the 3.4.9 bump showed flaky "TLS/SSL error: Connection timed out
(110)" failures across all MySQL tests (02479_mysql_connect_to_self,
02680_mysql_ast_logical_err, 02833_concurrent_sessions, test_storage_mysql,
test_dictionaries_mysql). Root cause: upstream v3.4.9 rewrote the TLS
wait_io_or_timeout() call sites to use a hardcoded 5 ms timeout; since the
handshake socket is non-blocking, that 5 ms poll is the only timeout
governing it, so under sanitizer load the handshake aborts spuriously.

Point at the fork commit that restores using the connection's configured
timeouts (pvio->timeout[...], in ms) for the TLS connect/read/write polls.

CI report: ClickHouse#108328
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
test_background_dictionary_reconnect asserted on the connector's host-error
text "Can't connect to MySQL server on ...". mariadb-connector-c 3.4.x
dropped "MySQL" from this message (errno 2003 is now "Can't connect to
server on '%-.64s' (%d)"), so the LIKE pattern matched 0 rows. Update the
pattern to the new wording. The reconnect logic itself is unaffected (the
other two assertions in the test pass).

CI report: ClickHouse#108328
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…nector-c-3.4.9

Bump `mariadb-connector-c` from 3.1.29 to 3.4.9
thevar1able added a commit that referenced this pull request Oct 14, 2026
Resolve conflicts: release 26.3 still carried `mariadb-connector-c` 3.1.29,
because the 3.4.9 bump (#108328)
was never backported. Take the master state of
`contrib/mariadb-connector-c-cmake/CMakeLists.txt` (zlib compression plugin,
`ma_decimal.c`, version 3.4.10) and the v3.4.10 submodule commit, and adjust
the expected connection error message in `test_dictionaries_mysql`, which
changed in connector 3.4.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-build Pull request with build/testing/packaging improvement pr-synced-to-cloud The PR is synced to the cloud repo submodule changed At least one submodule changed in this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants