Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MethodError when creating a connection #197

Closed
Octogonapus opened this issue Oct 5, 2022 · 1 comment · Fixed by #198
Closed

MethodError when creating a connection #197

Octogonapus opened this issue Oct 5, 2022 · 1 comment · Fixed by #198

Comments

@Octogonapus
Copy link
Contributor

When creating a connection I get this method error:

connect(
    MySQL.Connection,
    ENV["DB_HOST"],
    ENV["DB_USER"],
    ENV["DB_PASS"];
    unix_socket,
    db = ENV["DB_NAME"],
    port = parse(Int, string(ENV["DB_PORT"])),
    ssl_ca = ENV["USE_SSL"] == "true" ? joinpath(homedir(), "global-bundle.pem") : nothing,
    ssl_verify_server_cert = ENV["USE_SSL"] == "true" ? true : nothing,
    ssl_enforce = ENV["USE_SSL"] == "true" ? true : nothing,
)
│    MethodError: no method matching pointer(::Bool)
│    Closest candidates are:pointer(!Matched::SuiteSparse.CHOLMOD.Factor{Tv}) where Tv at /opt/hostedtoolcache/julia/1.7.3/x64/share/julia/stdlib/v1.7/SuiteSparse/src/cholmod.jl:360pointer(!Matched::PermutedDimsArray, !Matched::Integer) at /opt/hostedtoolcache/julia/1.7.3/x64/share/julia/base/permuteddimsarray.jl:61pointer(!Matched::Random.UnsafeView) at /opt/hostedtoolcache/julia/1.7.3/x64/share/julia/stdlib/v1.7/Random/src/RNGs.jl:516...
│    Stacktrace:
│      [1] setoption(mysql::MySQL.API.MYSQL, option::MySQL.API.mysql_option, arg::Bool)
│        @ MySQL.API ~/.julia/packages/MySQL/fUcEP/src/api/capi.jl:972
│      [2] #setoptions!#4
│        @ ~/.julia/packages/MySQL/fUcEP/src/MySQL.jl:206 [inlined]
│      [3] MySQL.Connection(host::String, user::String, passwd::String, db::String, port::Int64, unix_socket::String; kw::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:ssl_ca, :ssl_verify_server_cert, :ssl_enforce), Tuple{String, Bool, Bool}}})
│        @ MySQL ~/.julia/packages/MySQL/fUcEP/src/MySQL.jl:29
│      [4] #connect#5
│        @ ~/.julia/packages/MySQL/fUcEP/src/MySQL.jl:288 [inlined]

Seems to be related to ssl_verify_server_cert and ssl_enforce. I'm not sure if I am specifying them correctly; I'm just going off of the docs which state their types are Bool.

  • MySQL v1.4.0
  • Julia v1.7.3
quinnj added a commit that referenced this issue Oct 6, 2022
Fixes #197.

Not sure how this got missed, but it wasn't included in our "boolean options" when we set these at the C level.
@quinnj
Copy link
Member

quinnj commented Oct 6, 2022

Thanks for the report! Fix is up: #198

quinnj added a commit that referenced this issue Oct 6, 2022
#198)

Fixes #197.

Not sure how this got missed, but it wasn't included in our "boolean options" when we set these at the C level.
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 a pull request may close this issue.

2 participants