rem: var stmt = db.createStatement(sql); 
add: let stmt = db.createStatement(replaceInsert(gBaseQuery, 1, "name LIKE ?1 ESCAPE '/' AND state != ?2 AND state != ?3")); 
context: function buildDownloadListWithSearch(aTerms){  gSearching = true;  gDownloadsOtherLabel.value = gDownloadsOtherLabel.getAttribute("searchlabel");  // remove and trailing or leading whitespace first  aTerms = aTerms.replace(/^\s+|\s+$/, "");  if (aTerms.length == 0) {    gSearching = false;    gDownloadsOtherLabel.value = gDownloadsOtherLabel.getAttribute("completedlabel");    buildDefaultView();    return;  }  var sql = "SELECT id, target, name, source, state, startTime, referrer " +            "FROM moz_downloads WHERE name LIKE ?1 ESCAPE '/' " +            "AND state != ?2 AND state != ?3 ORDER BY endTime ASC";  var db = gDownloadManager.DBConnection;  var stmt = db.createStatement(sql);  try {    var paramForLike = stmt.escapeStringForLIKE(aTerms, '/');    stmt.bindStringParameter(0, "%" + paramForLike + "%");    stmt.bindInt32Parameter(1, Ci.nsIDownloadManager.DOWNLOAD_DOWNLOADING);    stmt.bindInt32Parameter(2, Ci.nsIDownloadManager.DOWNLOAD_PAUSED);    buildDownloadList(stmt, gDownloadsOtherTitle);  } finally {    stmt.reset();  }}
meta: 10520	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/10520/501718d8e30b7d693415403d4dd2edd4a6aa3935/downloads.js/buggy/toolkit/mozapps/downloads/content/downloads.js