Embed ids directly in Tags.getAllWithin() SQL to avoid parameter limit

This commit is contained in:
Dan Stillman 2020-03-24 14:49:57 -04:00
parent 679148d8d6
commit c62e725e2a

View file

@ -178,8 +178,7 @@ Zotero.Tags = new function() {
params.push(...types); params.push(...types);
} }
if (tagIDs) { if (tagIDs) {
sql += "AND tagID IN (" + new Array(tagIDs.length).fill('?').join(', ') + ") "; sql += "AND tagID IN (" + tagIDs.map(x => parseInt(x)).join(', ') + ") ";
params.push(...tagIDs);
} }
// Not a perfect locale sort, but speeds up the sort in the tag selector later without any // Not a perfect locale sort, but speeds up the sort in the tag selector later without any
// discernible performance cost // discernible performance cost