diff --git a/process/DuplicateScanner_lib/process.js b/process/DuplicateScanner_lib/process.js index f94019bc937c507935f270850d7170706833e9d9..9dd0aa2b7759cc011d1d96f3767cec753ed58f95 100644 --- a/process/DuplicateScanner_lib/process.js +++ b/process/DuplicateScanner_lib/process.js @@ -59,7 +59,7 @@ DuplicateScannerUtils.DeleteCachedDuplicate = function(pDuplicateId) SqlBuilder.IN()) .and("DUPLICATECLUSTERS.DUPLICATEID", pDuplicateId, SqlBuilder.NOT_EQUAL()); -var test = newSelect("CLUSTERID") +var clusterIdArray = newSelect("CLUSTERID") .from("DUPLICATECLUSTERS") .where("DUPLICATECLUSTERS.CLUSTERID", newSelect("CLUSTERID") .from("DUPLICATECLUSTERS") @@ -67,20 +67,11 @@ var test = newSelect("CLUSTERID") SqlBuilder.IN()) .and("DUPLICATECLUSTERS.DUPLICATEID", pDuplicateId, SqlBuilder.NOT_EQUAL()) .groupBy("CLUSTERID"); - - var so = "select count(ID),( select CLUSTERID from DUPLICATECLUSTERS)" -+ " from DUPLICATECLUSTERS where DUPLICATECLUSTERS.CLUSTERID in" -+ " (select CLUSTERID from DUPLICATECLUSTERS where(DUPLICATECLUSTERS.DUPLICATEID = ('" + pDuplicateId + "')))" -+ " and(" -+ " DUPLICATECLUSTERS.DUPLICATEID <> ('" + pDuplicateId + "')" -+ " )" -+ " group by CLUSTERID" var countAndClusterId = query.arrayRow(); - var testundso = test.arrayRow() let countDuplicatesInClusterWithoutParameterId = countAndClusterId[0]; - let clusterId = testundso[0]; + let clusterId = clusterIdArray[0]; //If only one duplicate would be remaining, //the whole cluster has to be deleted because there are no more duplicates.