commit d193afe7402f2c8323b5961358ed8d8098a465db parent 04d05548b2becae5a74a18304a5aacc546eb558e Author: Dan Stillman <dstillman@zotero.org> Date: Sun, 20 Aug 2006 07:34:37 +0000 Items without rows in the applicable table didn't show up for searches with isNot or doesNotContain conditions Diffstat:
| M | chrome/chromeFiles/content/scholar/xpcom/search.js | | | 21 | ++++++++++----------- |
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/chrome/chromeFiles/content/scholar/xpcom/search.js b/chrome/chromeFiles/content/scholar/xpcom/search.js @@ -289,7 +289,14 @@ Scholar.Search.prototype._buildQuery = function(){ case 'savedSearches': break; default: - condSQL += 'itemID IN (SELECT itemID FROM ' + i + ' WHERE ('; + condSQL += 'itemID ' + switch (tables[i][j]['operator']){ + case 'isNot': + case 'doesNotContain': + condSQL += 'NOT '; + break; + } + condSQL += 'IN (SELECT itemID FROM ' + i + ' WHERE ('; openParens = 2; } @@ -366,25 +373,17 @@ Scholar.Search.prototype._buildQuery = function(){ condSQL += tables[i][j]['field']; switch (tables[i][j]['operator']){ case 'contains': + case 'doesNotContain': // excluded with NOT IN above condSQL += ' LIKE ?'; condSQLParams.push('%' + tables[i][j]['value'] + '%'); break; - case 'doesNotContain': - condSQL += ' NOT LIKE ?'; - condSQLParams.push('%' + tables[i][j]['value'] + '%'); - break; - case 'is': + case 'isNot': // excluded with NOT IN above condSQL += '=?'; condSQLParams.push(tables[i][j]['value']); break; - case 'isNot': - condSQL += '!=?'; - condSQLParams.push(tables[i][j]['value']); - break; - case 'greaterThan': condSQL += '>?'; condSQLParams.push({int:tables[i][j]['value']});