mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fix(ext/node): sqlite handle empty blob being NULL (#28674)
Fixes https://github.com/denoland/deno/issues/28672
This commit is contained in:
parent
0f40ee7ff4
commit
5bc4266101
4 changed files with 40 additions and 12 deletions
|
@ -319,3 +319,17 @@ RETURNING id
|
|||
const id1 = insertPeople.run({ name: "Flash", birthdate: "1956-07-16" });
|
||||
assertEquals(id1, { lastInsertRowid: 1, changes: 1 });
|
||||
});
|
||||
|
||||
Deno.test("[node/sqlite] StatementSync empty blob", () => {
|
||||
const db = new DatabaseSync(":memory:");
|
||||
|
||||
db.exec("CREATE TABLE foo(a BLOB NOT NULL)");
|
||||
|
||||
db.prepare("INSERT into foo (a) values (?)")
|
||||
.all(new Uint8Array([]));
|
||||
|
||||
const result = db.prepare("SELECT * from foo").get();
|
||||
assertEquals(result, { a: new Uint8Array([]), __proto__: null });
|
||||
|
||||
db.close();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue