Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
name = "MySQL"
uuid = "39abe10b-433b-5dbd-92d4-e302a9df00cd"
author = ["quinnj"]
version = "1.5.0"
version = "1.5.1"

[deps]
DBInterface = "a10d1c49-ce27-4219-8d33-6db1a4562965"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
DecFP = "55939f99-70c6-5e9b-8bb0-5071ed7d61fd"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
MariaDB_Connector_C_jll = "aabc7e14-95f1-5e66-9f32-aea603782360"
OpenSSL_jll = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
Parsers = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
Expand All @@ -17,6 +18,7 @@ Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
DBInterface = "2.5"
DecFP = "0.4.9, 0.4.10, 1"
MariaDB_Connector_C_jll = "3.1.12"
OpenSSL_jll = "3"
Parsers = "0.3, 1, 2"
Tables = "1"
julia = "1.6"
Expand Down
17 changes: 16 additions & 1 deletion src/api/API.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
module API

using Dates, DecFP
using Dates, DecFP, Libdl

export DateAndTime

using MariaDB_Connector_C_jll
using OpenSSL_jll: libssl, libcrypto

const PLUGIN_DIR = joinpath(MariaDB_Connector_C_jll.artifact_dir, "lib", "mariadb", "plugin")

# Pre-load OpenSSL libraries so they're available when MariaDB loads plugins.
# MariaDB authentication plugins (e.g., caching_sha2_password) depend on OpenSSL,
# but when MariaDB loads them via dlopen, the dynamic linker can't find OpenSSL
# because it's in a different artifact. By loading OpenSSL with RTLD_GLOBAL first,
# its symbols become available to subsequently loaded libraries.
# See: https://github.com/JuliaDatabases/MySQL.jl/issues/232
function __init__()
@static if !Sys.iswindows()
Libdl.dlopen(libcrypto, Libdl.RTLD_GLOBAL)
Libdl.dlopen(libssl, Libdl.RTLD_GLOBAL)
end
end

# const definitions from mysql client library
include("consts.jl")

Expand Down