Fix query used by purge operation for case-sensitive fileystems.

The table we are inserting into should contain the files that are to be
deleted, not the files that are to be kept.

This fixes issue #3927.
This commit is contained in:
Kenneth Hsu
2019-09-29 09:52:35 -07:00
parent c412bc9cae
commit 9333517950
@@ -123,7 +123,7 @@ namespace Duplicati.Library.Main.Database
cmd.ExecuteNonQuery();
}
cmd.ExecuteNonQuery(string.Format(@"INSERT INTO ""{0}"" (""FileID"") SELECT DISTINCT ""A"".""FileID"" FROM ""FilesetEntry"" A, ""File"" B WHERE ""A"".""FilesetID"" = ? AND ""A"".""FileID"" = ""B"".""ID"" AND ""B"".""Path"" NOT IN ""{1}""", m_tablename, filenamestable), ParentID);
cmd.ExecuteNonQuery(string.Format(@"INSERT INTO ""{0}"" (""FileID"") SELECT DISTINCT ""A"".""FileID"" FROM ""FilesetEntry"" A, ""File"" B WHERE ""A"".""FilesetID"" = ? AND ""A"".""FileID"" = ""B"".""ID"" AND ""B"".""Path"" IN ""{1}""", m_tablename, filenamestable), ParentID);
cmd.ExecuteNonQuery(string.Format(@"DROP TABLE IF EXISTS ""{0}"" ", filenamestable));
}
}