Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PhilETaylor/26e59abfa4a0bd081267ea019795bf04 to your computer and use it in GitHub Desktop.
Save PhilETaylor/26e59abfa4a0bd081267ea019795bf04 to your computer and use it in GitHub Desktop.
UPDATE bf_files AS NEWTABLE
INNER JOIN (
SELECT
bf_files_last.filewithpath,
bf_files_last.suspectcontent, bf_files_last.falsepositive,
bf_files_last.encrypted FROM bf_files_last
LEFT JOIN
bf_files ON
bf_files_last.filewithpath = bf_files.filewithpath
WHERE
bf_files_last.currenthash =
bf_files.currenthash
AND
bf_files_last.filemtime =
bf_files.filemtime
AND
bf_files_last.fileperms =
bf_files.fileperms
AND
bf_files_last.filewithpath =
bf_files.filewithpath
) AS
OLDTABLE
ON
NEWTABLE.filewithpath =
OLDTABLE.filewithpath
SET
NEWTABLE.filewithpath =
OLDTABLE.filewithpath,
NEWTABLE.suspectcontent =
OLDTABLE.suspectcontent,
NEWTABLE.falsepositive =
OLDTABLE.falsepositive,
NEWTABLE.encrypted =
OLDTABLE.encrypted,
NEWTABLE.queued = 0
WHERE
OLDTABLE.suspectcontent != 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment