From b99aeae76ef9e17ce3935b0c644535392bc5d948 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 17 Feb 2022 01:41:52 -0500 Subject: [PATCH] Add DB test for combination of numbered and unnumbered query placeholders --- test/tests/dbTest.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/tests/dbTest.js b/test/tests/dbTest.js index 81134c86cb..21516a65c1 100644 --- a/test/tests/dbTest.js +++ b/test/tests/dbTest.js @@ -73,7 +73,14 @@ describe("Zotero.DB", function() { assert.lengthOf(rows, 2); assert.equal(rows[0].a, 1); assert.equal(rows[1].a, 3); - }) + }); + + it("should accept combination of numbered and unnumbered placeholders", async function () { + var rows = await Zotero.DB.queryAsync("SELECT a FROM " + tmpTable + " WHERE (a=?1 OR b=?1) OR b=?", [2, 4]); + assert.lengthOf(rows, 2); + assert.equal(rows[0].a, 1); + assert.equal(rows[1].a, 3); + }); it("should accept a single placeholder within parentheses", function* () { var rows = yield Zotero.DB.queryAsync("SELECT a FROM " + tmpTable + " WHERE b IN (?)", 2);