Skip to content

Commit

Permalink
Hack in unions for each call to itemData and itemCreators (isNot sear…
Browse files Browse the repository at this point in the history
…ches failed).
  • Loading branch information
fbennett committed Sep 10, 2017
1 parent 91c5c90 commit b1f29aa
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions chrome/content/zotero/xpcom/data/search.js
Expand Up @@ -1665,12 +1665,9 @@ Zotero.Search.prototype._buildQuery = Zotero.Promise.coroutine(function* () {
}
}

var altsql = sql
.replace(/\s+itemData\s+/g, " itemDataAlt ")
.replace(/\s+itemCreatorsAlt\s+/g, " itemCreatorsAlt ");
this._sql = sql
.replace(/\s+itemData\s+/g, " (SELECT * FROM itemData UNION ALL SELECT itemID,fieldID,valueID FROM itemDataAlt) ")
.replace(/\s+itemCreators\s+/g, " (SELECT * FROM itemCreators UNION ALL SELECT itemID,creatorID,creatorTypeID,orderIndex FROM itemCreatorsAlt) ");

var realsql = sql + " UNION " + altsql;

this._sql = realsql;
this._sqlParams = sqlParams.length ? sqlParams.concat(sqlParams): false;
this._sqlParams = sqlParams.length ? sqlParams: false;
});

0 comments on commit b1f29aa

Please sign in to comment.