Francois Gouget : testbot/orm: Take the filters into account in DBIBackend::DeleteAll().
Alexandre Julliard
julliard at winehq.org
Wed Jun 1 14:41:16 CDT 2022
Module: tools
Branch: master
Commit: 8c1022c523acce29f077e52bbe4caa0cdcdd657e
URL: https://source.winehq.org/git/tools.git/?a=commit;h=8c1022c523acce29f077e52bbe4caa0cdcdd657e
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Wed Jun 1 14:52:10 2022 +0200
testbot/orm: Take the filters into account in DBIBackend::DeleteAll().
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
testbot/lib/ObjectModel/DBIBackEnd.pm | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/testbot/lib/ObjectModel/DBIBackEnd.pm b/testbot/lib/ObjectModel/DBIBackEnd.pm
index 940d37f..07b838d 100644
--- a/testbot/lib/ObjectModel/DBIBackEnd.pm
+++ b/testbot/lib/ObjectModel/DBIBackEnd.pm
@@ -738,6 +738,22 @@ sub DeleteAll($$)
push @Data, @{$MasterColValues};
}
+ my $Filter = $Collection->GetFilter();
+ if ($Filter)
+ {
+ my ($Composite, $FilterWhere, $FilterData) = GetFilterWhere($self, $Collection, $Filter);
+ if ($Where ne "")
+ {
+ $Where .= ($Composite ? " AND ($FilterWhere)" : " AND $FilterWhere");
+ push @Data, @$FilterData;
+ }
+ else
+ {
+ $Where = $FilterWhere;
+ @Data = @$FilterData;
+ }
+ }
+
my $Query = "DELETE FROM " . $Collection->GetTableName();
if ($Where ne "")
{
More information about the wine-cvs
mailing list