Skip to content

Commit 7911e35

Browse files
committedMar 25, 2020
segfault
1 parent 808dd6e commit 7911e35

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed
 

‎src/util/macros.lzz

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ void ThrowRangeError(const char* message) { EasyIsolate; isolate->ThrowException
6161
if (!db->open) \
6262
return ThrowTypeError("The database connection is not open")
6363
#define REQUIRE_DATABASE_NOT_BUSY(db) \
64-
if (db->busy) \
64+
if (db->busy && !db->unsafe_mode) \
6565
return ThrowTypeError("This database connection is busy executing a query")
6666
#define REQUIRE_DATABASE_NO_ITERATORS(db) \
67-
if (db->iterators && !db->unsafe_mode) \
67+
if (db->iterators && !db->unsafe_mode) \
6868
return ThrowTypeError("This database connection is busy executing a query")
6969
#define REQUIRE_STATEMENT_NOT_LOCKED(stmt) \
7070
if (stmt->locked) \

‎test/42.integrity.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('integrity checks', function () {
77
beforeEach(function () {
88
let func = () => {};
99
this.useFunc = fn => { func = fn; };
10-
this.db = new Database(util.next());
10+
this.db = new Database(util.next(), {unsafe: true});
1111
this.db.prepare("CREATE TABLE entries (a TEXT, b INTEGER, c REAL, d BLOB, e TEXT)").run();
1212
this.db.prepare("INSERT INTO entries WITH RECURSIVE temp(a, b, c, d, e) AS (SELECT 'foo', 1, 3.14, x'dddddddd', NULL UNION ALL SELECT a, b + 1, c, d, e FROM temp LIMIT 5) SELECT * FROM temp").run();
1313
this.db.function('func', x => (func(), x));
@@ -19,8 +19,8 @@ describe('integrity checks', function () {
1919
this.db.close();
2020
});
2121

22-
const allowed = fn => () => expect(fn).to.not.throw();
23-
const blocked = fn => () => expect(fn).to.throw(TypeError);
22+
const blocked = fn => () => expect(fn).to.not.throw();
23+
const allowed = fn => () => expect(fn).to.throw(TypeError);
2424
const normally = fn => fn();
2525
const whileIterating = (self, fn) => {
2626
let count = 0;

0 commit comments

Comments
 (0)