aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-08-04 18:53:54 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-08-04 18:54:08 -0700
commit637a38f394704eaea29b503a69d554b5726d6214 (patch)
tree288cbd30b0bbf97d95ebf20939a6cb6eb0b4bcee /test
parent190ba6b74380f4e92cea9e38ecce63cbcb7002b4 (diff)
downloadbun-637a38f394704eaea29b503a69d554b5726d6214.tar.gz
bun-637a38f394704eaea29b503a69d554b5726d6214.tar.zst
bun-637a38f394704eaea29b503a69d554b5726d6214.zip
Fixes #3991
Fixes #3991
Diffstat (limited to 'test')
-rw-r--r--test/js/bun/sqlite/sqlite.test.js36
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");
+});