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

Misleading ERROR: SQLiteException("out of memory") caused by closed database #324

Open
wjholden opened this issue Feb 9, 2023 · 0 comments · May be fixed by #337
Open

Misleading ERROR: SQLiteException("out of memory") caused by closed database #324

wjholden opened this issue Feb 9, 2023 · 0 comments · May be fixed by #337

Comments

@wjholden
Copy link

wjholden commented Feb 9, 2023

I am creating this issue to hopefully help the next person who gets surprised by a misleading error message.

Suppose you build a SQLite database in Julia and you close it.

julia> using SQLite, DataFrames

julia> db = SQLite.DB("example.db");

julia> DBInterface.execute(db, "CREATE TABLE Example (ID INTEGER PRIMARY KEY)");

julia> DBInterface.execute(db, "INSERT INTO Example VALUES (1)");

julia> DBInterface.execute(db, "SELECT * FROM Example") |> DataFrame
1×1 DataFrame
 Row │ ID
     │ Int64
─────┼───────
   1 │     1

julia> close(db)

If you try to query the database again, you will get an "out of memory" error.

julia> DBInterface.execute(db, "SELECT * FROM Example") |> DataFrame
ERROR: SQLiteException("out of memory")
Stacktrace:
  [1] sqliteerror(args::SQLite.DB)
    @ SQLite C:\Users\wjhol\.julia\packages\SQLite\aeqsS\src\SQLite.jl:34
  [2] macro expansion
    @ C:\Users\wjhol\.julia\packages\SQLite\aeqsS\src\base.jl:10 [inlined]
  [3] prepare_stmt_wrapper
    @ C:\Users\wjhol\.julia\packages\SQLite\aeqsS\src\SQLite.jl:109 [inlined]
  [4] SQLite.Stmt(db::SQLite.DB, sql::String; register::Bool)
    @ SQLite C:\Users\wjhol\.julia\packages\SQLite\aeqsS\src\SQLite.jl:146
  [5] Stmt
    @ C:\Users\wjhol\.julia\packages\SQLite\aeqsS\src\SQLite.jl:145 [inlined]
  [6] prepare
    @ C:\Users\wjhol\.julia\packages\SQLite\aeqsS\src\SQLite.jl:180 [inlined]
  [7] execute
    @ C:\Users\wjhol\.julia\packages\DBInterface\1Gmxx\src\DBInterface.jl:130 [inlined]
  [8] #execute#2
    @ C:\Users\wjhol\.julia\packages\DBInterface\1Gmxx\src\DBInterface.jl:152 [inlined]
  [9] execute(conn::SQLite.DB, sql::String)
    @ DBInterface C:\Users\wjhol\.julia\packages\DBInterface\1Gmxx\src\DBInterface.jl:152
 [10] top-level scope
    @ REPL[7]:1
@evetion evetion linked a pull request Oct 26, 2023 that will close this issue
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.

1 participant