Skip to content

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

@asbisen

Description

@asbisen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions