diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/SingleDataSource.java b/Core/src/org/sleuthkit/autopsy/commonfilesearch/SingleDataSource.java index d25f8aec73..d2601eb025 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/SingleDataSource.java +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/SingleDataSource.java @@ -26,7 +26,7 @@ import java.util.Map; */ class SingleDataSource extends CommonFilesMetaDataBuilder { - private static final String WHERE_CLAUSE = "md5 in (select md5 from tsk_files where data_source_obj_id=%s and (known != 1 OR known IS NULL) GROUP BY md5 HAVING COUNT(*) > 1) AND data_source_obj_id=%s order by md5"; + private static final String WHERE_CLAUSE = "md5 in (select md5 from tsk_files where md5 in (select md5 from tsk_files where (known != 1 OR known IS NULL) and data_source_obj_id=%s) GROUP BY md5 HAVING COUNT(*) > 1) order by md5"; private final Long selectedDataSourceId; public SingleDataSource(Long dataSourceId, Map dataSourceIdMap) { @@ -36,7 +36,7 @@ class SingleDataSource extends CommonFilesMetaDataBuilder { @Override protected String buildSqlWhereClause() { - Object[] args = new String[]{Long.toString(this.selectedDataSourceId), Long.toString(this.selectedDataSourceId)}; + Object[] args = new String[]{Long.toString(this.selectedDataSourceId)}; return String.format(SingleDataSource.WHERE_CLAUSE, args); } }