Skip to content

Conversation

@quinnj
Copy link
Member

@quinnj quinnj commented Jan 29, 2026

Summary

  • Pre-load OpenSSL libraries with RTLD_GLOBAL to fix plugin loading on macOS/Linux
  • Add OpenSSL_jll as explicit dependency

Problem

MariaDB authentication plugins (e.g., caching_sha2_password) depend on OpenSSL, but when MariaDB loads them via dlopen at runtime, the dynamic linker can't find OpenSSL because:

  1. The plugin has @rpath/libssl.3.dylib as a dependency
  2. The embedded rpath points to the MariaDB artifact root
  3. OpenSSL is in a completely different artifact (Julia's installation directory)

Solution

Pre-load OpenSSL libraries with RTLD_GLOBAL when the API module initializes. This makes OpenSSL symbols globally available to subsequently loaded libraries, allowing the plugins to find them even though the @rpath can't resolve to the actual file location.

Test plan

  • Verify package loads correctly
  • Test connection to MySQL 8.0+ server using caching_sha2_password authentication (the default)

Fixes #232


@nakagami Could you please test this PR to verify it fixes the issue on your system? You can try it with:

using Pkg
Pkg.add(url="https://github.com/JuliaDatabases/MySQL.jl", rev="jq/fix-openssl-plugin-loading")

🤖 Generated with Claude Code

MariaDB authentication plugins (e.g., caching_sha2_password) depend on
OpenSSL, but when MariaDB loads them via dlopen at runtime, the dynamic
linker can't find OpenSSL because it's in a different JLL artifact.

This fix pre-loads OpenSSL libraries with RTLD_GLOBAL when the API module
initializes. This makes OpenSSL symbols globally available to subsequently
loaded libraries, allowing the plugins to find them.

Fixes #232

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.40%. Comparing base (d5c20f9) to head (c8b70a6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #233      +/-   ##
==========================================
+ Coverage   63.27%   63.40%   +0.13%     
==========================================
  Files           9       10       +1     
  Lines        1111     1115       +4     
==========================================
+ Hits          703      707       +4     
  Misses        408      408              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@quinnj quinnj merged commit bfdcb57 into main Jan 30, 2026
9 of 10 checks passed
@quinnj quinnj deleted the jq/fix-openssl-plugin-loading branch January 30, 2026 01:59
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.

macOS can't find libssl.3.dylib

2 participants