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

Error: DBInterface.execute(conn, "SHOW TABLES;") #219

Open
asbisen opened this issue Jul 9, 2024 · 2 comments
Open

Error: DBInterface.execute(conn, "SHOW TABLES;") #219

asbisen opened this issue Jul 9, 2024 · 2 comments

Comments

@asbisen
Copy link

asbisen commented Jul 9, 2024

The cursor from "SHOW TABLES;" fails to materialize into a DataFrame. Below is the example

using DataFrames
using MySQL

conn = DBInterface.connect(MySQL.Connection, "127.0.0.1", "root", "password"; port=3306)

r = DBInterface.execute(conn, "DROP DATABASE IF EXISTS testx;") |> DataFrame
r = DBInterface.execute(conn, "CREATE DATABASE testx;") |> DataFrame
println(r)

r = DBInterface.execute(conn, "USE testx;") |> DataFrame
println(r)

sql = """create table LOC  (
    location_id VARCHAR(100),
    alias VARCHAR(50));
    """
r = DBInterface.execute(conn, sql) |> DataFrame
println(r)

r = DBInterface.execute(conn, "SHOW TABLES;") |> DataFrame
println(r)

Error:

ERROR: ArgumentError: invalid number format LOC
Stacktrace:
  [1] parse(::Type{DecFP.Dec64}, s::String)
    @ DecFP ~/.julia/packages/DecFP/Cud5F/src/DecFP.jl:323
  [2] cast
    @ ~/.julia/packages/MySQL/NMNbH/src/execute.jl:50 [inlined]
  [3] getcolumn
    @ ~/.julia/packages/MySQL/NMNbH/src/execute.jl:105 [inlined]
  [4] eachcolumns
    @ ~/.julia/packages/Tables/NSGZI/src/utils.jl:111 [inlined]
  [5] buildcolumns(schema::Tables.Schema{(:Tables_in_testx,), Tuple{DecFP.Dec64}}, rowitr::MySQL.TextCursor{true})
    @ Tables ~/.julia/packages/Tables/NSGZI/src/fallbacks.jl:147
  [6] _columns
    @ ~/.julia/packages/Tables/NSGZI/src/fallbacks.jl:265 [inlined]
  [7] columns
    @ ~/.julia/packages/Tables/NSGZI/src/fallbacks.jl:258 [inlined]
  [8] DataFrame(x::MySQL.TextCursor{true}; copycols::Nothing)
    @ DataFrames ~/.julia/packages/DataFrames/58MUJ/src/other/tables.jl:57
  [9] DataFrame
    @ ~/.julia/packages/DataFrames/58MUJ/src/other/tables.jl:48 [inlined]
 [10] |>(x::MySQL.TextCursor{true}, f::Type{DataFrame})
    @ Base ./operators.jl:917
 [11] top-level scope
    @ REPL[113]:1

Update: this issue only happens with MariaDB 11.2.4 and not with 10.11.8

@serenity4
Copy link

I stumbled upon a similar error, and managed to fix the issue by removing the strict version bound on MariaDB_Connector_C_jll ("=3.1.12" to "3.1.12"). With the latest version of this dependency (3.3.9 at the time of writing), I can at least get columns (not sure what else might break though).

@serenity4
Copy link

This is actually a duplicate of #208 already.

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

No branches or pull requests

2 participants