node-sqlite3 icon indicating copy to clipboard operation
node-sqlite3 copied to clipboard

Tracing causes commands to hang when serialized on 4.1.0

Open jaredkrinke opened this issue 6 years ago • 1 comments

If I enable tracing ("db.on('trace', …)") while a database is serialized ("db.serialize()"), the first command I try to execute appears hangs indefinitely. If either tracing or serialization is off, I don't see this issue.

For example, in the following code, the callback is never called:

var sqlite3 = require('sqlite3');
var db = new sqlite3.Database(":memory:");
db.serialize();
db.on("trace", console.log);
db.run("CREATE TABLE Test (Id INTEGER)", function (err) {
    console.log(`Callback: ${err}`);
});

jaredkrinke avatar Nov 19 '19 18:11 jaredkrinke

Huh - odd! I just ran into the same whilst working on https://github.com/TryGhost/node-sqlite3/pull/1267

daniellockyer avatar Sep 08 '22 21:09 daniellockyer