I’m running a simple SQL select from a table and getting the stacktrace below. I have been using this code for months and today is the first time I’ve seen it so it could be related to me running Pkg.update() recently.
First of all, should “0E-24” be a valid Decimal in the Decimals package? If so, I guess there is a bug in that. If not, is there some way to override how libpq is parsing what it gets back to workaround this problem? Using a separate SQL tool, it appears there is a 0 in the column that is causing the problem, so I’m not sure why it’s showing 0E-24.
julia> rowtable(execute(db, "select * from mytable where id=111"))
ERROR: ArgumentError: invalid BigInt: "0E-24"
Stacktrace:
[1] tryparse_internal(#unused#::Type{BigInt}, s::String, startpos::Int64, endpos::Int64, base_::Int64, raise::Bool)
@ Base.GMP .\gmp.jl:285
[2] parse(::Type{BigInt}, s::String; base::Nothing)
@ Base .\parse.jl:241
[3] parse
@ .\parse.jl:241 [inlined]
[4] parameters
@ C:\Users\joel\.julia\packages\Decimals\Sb4j1\src\decimal.jl:19 [inlined]
[5] parse(#unused#::Type{Decimals.Decimal}, str::String)
@ Decimals C:\Users\joel\.julia\packages\Decimals\Sb4j1\src\decimal.jl:6
[6] pqparse
@ C:\Users\joel\.julia\packages\LibPQ\6itxv\src\parsing.jl:138 [inlined]
[7] parse(#unused#::Type{Decimals.Decimal}, pqv::LibPQ.PQValue{0x000006a4, false})
@ LibPQ C:\Users\joel\.julia\packages\LibPQ\6itxv\src\parsing.jl:127
[8] (::LibPQ.var"#parse_type#82"{DataType})(pqv::LibPQ.PQValue{0x000006a4, false})
@ LibPQ C:\Users\joel\.julia\packages\LibPQ\6itxv\src\parsing.jl:690
[9] getindex(jl_result::LibPQ.Result{false}, row::Int64, col::Int64)
@ LibPQ C:\Users\joel\.julia\packages\LibPQ\6itxv\src\results.jl:545
[10] getproperty(pqrow::LibPQ.Row, name::Symbol)
@ LibPQ C:\Users\joel\.julia\packages\LibPQ\6itxv\src\tables.jl:37
[11] getcolumn
@ C:\Users\joel\.julia\packages\Tables\PxO1m\src\Tables.jl:102 [inlined]
[12] getcolumn
@ C:\Users\joel\.julia\packages\Tables\PxO1m\src\Tables.jl:103 [inlined]
[13] macro expansion
@ C:\Users\joel\.julia\packages\Tables\PxO1m\src\namedtuples.jl:50 [inlined]
[14] _iterate(rows::Tables.NamedTupleIterator{Tables.Schema{(:tid, :tscreated, :primitdir, :targetdate, :underbid, :underask, :prilldiropen, :prilldirclose, :tsfilled, :tsclosed, :status), Tuple{Union{Missing, Int64}, Union{Missing, DateTime}, Union{Missing, Decimals.Decimal}, Union{Missing, Date}, Union{Missing, Decimals.Decimal}, Union{Missing, Decimals.Decimal}, Union{Missing, Decimals.Decimal}, Union{Missing, Decimals.Decimal}, Union{Missing, DateTime}, Union{Missing, DateTime}, Union{Missing, String}}}, LibPQ.Result{false}}, st::Tuple{})
@ Tables C:\Users\joel\.julia\packages\Tables\PxO1m\src\namedtuples.jl:41
[15] iterate
@ C:\Users\joel\.julia\packages\Tables\PxO1m\src\namedtuples.jl:62 [inlined]
[16] iterate
@ C:\Users\joel\.julia\packages\Tables\PxO1m\src\namedtuples.jl:61 [inlined]
[17] copyto!(dest::Vector{NamedTuple{(:tid, :tscreated, :primitdir, :targetdate, :underbid, :underask, :prilldiropen, :prilldirclose, :tsfilled, :tsclosed, :status), Tuple{Union{Missing, Int64}, Union{Missing, DateTime},
Union{Missing, Decimals.Decimal}, Union{Missing, Date}, Union{Missing, Decimals.Decimal}, Union{Missing, Decimals.Decimal}, Union{Missing, Decimals.Decimal}, Union{Missing, Decimals.Decimal}, Union{Missing, DateTime}, Union{Missing, DateTime}, Union{Missing, String}}}}, src::Tables.NamedTupleIterator{Tables.Schema{(:tid, :tscreated, :primitdir, :targetdate, :underbid, :underask, :prilldiropen, :prilldirclose, :tsfilled, :tsclosed, :status), Tuple{Union{Missing, Int64}, Union{Missing, DateTime}, Union{Missing, Decimals.Decimal}, Union{Missing, Date}, Union{Missing, Decimals.Decimal}, Union{Missing, Decimals.Decimal}, Union{Missing, Decimals.Decimal}, Union{Missing, Decimals.Decimal}, Union{Missing, DateTime}, Union{Missing, DateTime}, Union{Missing, String}}}, LibPQ.Result{false}})
@ Base .\abstractarray.jl:890
[18] _collect
@ .\array.jl:655 [inlined]
[19] collect(itr::Tables.NamedTupleIterator{Tables.Schema{(:tid, :tscreated, :primitdir, :targetdate, :underbid, :underask, :prilldiropen, :prilldirclose, :tsfilled, :tsclosed, :status), Tuple{Union{Missing, Int64}, Union{Missing, DateTime}, Union{Missing, Decimals.Decimal}, Union{Missing, Date}, Union{Missing, Decimals.Decimal}, Union{Missing, Decimals.Decimal}, Union{Missing, Decimals.Decimal}, Union{Missing, Decimals.Decimal}, Union{Missing, DateTime}, Union{Missing, DateTime}, Union{Missing, String}}}, LibPQ.Result{false}})
@ Base .\array.jl:649
[20] rowtable(itr::LibPQ.Result{false})
@ Tables C:\Users\joel\.julia\packages\Tables\PxO1m\src\namedtuples.jl:106
[21] top-level scope
@ REPL[18]:1