diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/js/bun/sqlite/sqlite.test.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/js/bun/sqlite/sqlite.test.js b/test/js/bun/sqlite/sqlite.test.js index e4725cac2..7998f7469 100644 --- a/test/js/bun/sqlite/sqlite.test.js +++ b/test/js/bun/sqlite/sqlite.test.js @@ -553,3 +553,39 @@ describe("Database.run", () => { } }); }); + +it("#3991", () => { + const db = new Database(":memory:"); + db.prepare( + `CREATE TABLE IF NOT EXISTS users ( + id TEXT PRIMARY KEY, + xx TEXT) +`, + ).run(); + + db.prepare( + `insert into users (id, xx) values ( + 'foobar', + '{ + "links": [{"1": { + "2": "https://foobar.to/123", + "3": "4" + }}] + + }' +)`, + ).run(); + + let x = db + .query( + `SELECT * FROM users + WHERE users.id = 'foobar' + limit 1`, + ) + .get(); + + // Check we don't crash when a column with a string value greater than 64 characters is present. + expect(x.abc).toBeUndefined(); + + expect(x.id).toBe("foobar"); +}); |
