diff --git a/src/results.jl b/src/results.jl index d171675e..79056902 100644 --- a/src/results.jl +++ b/src/results.jl @@ -506,7 +506,7 @@ The returned value will be `missing` if `NULL`, or will be of the type specified [`column_types`](@ref). """ function Base.getindex(jl_result::Result, row::Integer, col::Integer) - if isnull(jl_result, row, col) + if isnull(jl_result, row, column_number(jl_result, col)) return missing else oid = column_oids(jl_result)[col] diff --git a/test/runtests.jl b/test/runtests.jl index 6e3c8812..816e140e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -916,6 +916,7 @@ end @test data[1][2] == "bar" @test data[2].yes_nulls === missing @test data[2][2] === missing + @test_throws BoundsError data[1].fake_column # columns ct = Tables.columns(result)