Skip to content
Snippets Groups Projects
Unverified Commit e9e86b11 authored by Richard Cordovano's avatar Richard Cordovano Committed by GitHub
Browse files

Merge pull request #2426 from...

Merge pull request #2426 from markmckinnon/7659-Deleting-a-report-does-not-delete-it-from-the-tsk_objects-table

7659-Deleting-a-report-does-not-delete-it-from-the-tsk_objects-table
parents bf08b609 da66063c
No related branches found
No related tags found
No related merge requests found
......@@ -12114,6 +12114,11 @@ public void deleteReport(Report report) throws TskCoreException {
PreparedStatement statement = connection.getPreparedStatement(PREPARED_STATEMENT.DELETE_REPORT);
statement.setLong(1, report.getId());
connection.executeUpdate(statement);
// DELETE FROM tsk_objects WHERE tsk_objects.obj_id = ?
statement = connection.getPreparedStatement(PREPARED_STATEMENT.DELETE_REPORT_TSK_OBJECT);
statement.setLong(1, report.getId());
statement.setLong(2, TskData.ObjectType.REPORT.getObjectType());
connection.executeUpdate(statement);
} catch (SQLException ex) {
throw new TskCoreException("Error querying reports table", ex);
} finally {
......@@ -12593,6 +12598,7 @@ private enum PREPARED_STATEMENT {
SELECT_REPORT_BY_ID("SELECT * FROM reports WHERE obj_id = ?"), //NON-NLS
INSERT_REPORT("INSERT INTO reports (obj_id, path, crtime, src_module_name, report_name) VALUES (?, ?, ?, ?, ?)"), //NON-NLS
DELETE_REPORT("DELETE FROM reports WHERE reports.obj_id = ?"), //NON-NLS
DELETE_REPORT_TSK_OBJECT("DELETE FROM tsk_objects where tsk_objects.obj_id = ? and tsk_objects.type = ?"),
INSERT_INGEST_JOB("INSERT INTO ingest_jobs (obj_id, host_name, start_date_time, end_date_time, status_id, settings_dir) VALUES (?, ?, ?, ?, ?, ?)"), //NON-NLS
INSERT_INGEST_MODULE("INSERT INTO ingest_modules (display_name, unique_name, type_id, version) VALUES(?, ?, ?, ?)"), //NON-NLS
SELECT_ATTR_BY_VALUE_BYTE("SELECT source FROM blackboard_attributes WHERE artifact_id = ? AND attribute_type_id = ? AND value_type = 4 AND value_byte = ?"), //NON-NLS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment