When calling functions on a closed database, confusing "out of memory" error is reported
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- javascript, sqlite
- 領域
- database
研究方向
Start at Database.prototype.handleError in the issue's JavaScript snippet and reproduce calling each on a closed database. Check how the null database reaches sqlite3_errmsg; done means the closed-database case reports an intuitive error instead of "out of memory."
由索引模型根據 Issue 內容生成。
描述
I realize that calling methods on a database that's been closed is not a good idea. However, when calling a method like each on the closed database, the error reported is out of memory. The underlying db is nulled out on close (which makes sense). But then, in the handleError method:
Database.prototype.handleError = function(returnCode) {
var errmsg;
if (returnCode === SQLite.OK) {
return null;
} else {
errmsg = sqlite3_errmsg(this.db);
throw new Error(errmsg);
}
};
We're passing null into the sqlite3_errmsg. That in turn causes it to report it as a memory allocation error.
Ideally, the error reported would be something more intuitive. I bring this up because I am now closing databases that we are no longer using in an effort to fix a real memory allocation error. However, in the process of doing so, I accidentally closed a database I shouldn't have and continued to get what looked like memory errors. It wasn't until later that I realized this message was inaccurate.
- 主要語言
- JavaScript
- 星號
- 13.7k
- 分支
- 1.1k
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
sql-js/sql.js 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 48/100
-
難度 4/5 3-5 天 新手友好度 35/100
-
難度 2/5 1-3 小時 新手友好度 45/100
-
難度 4/5 3-5 天 新手友好度 35/100
-
難度 4/5 3-5 天 新手友好度 35/100
相似的 Issue
-
enhancement
難度 2/5 1-3 小時 新手友好度 70/100
babalae/bettergi-scripts-list#3674 ·
-
難度 2/5 1-3 小時 新手友好度 88/100
vadimdemedes/ink#1029 ·
-
code-quality refactoring
難度 2/5 1-3 小時 新手友好度 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
難度 2/5 1-3 小時 新手友好度 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
難度 2/5 1-3 小時 新手友好度 86/100
githubnext/gh-aw-cao#13143 ·