Module: tools Branch: master Commit: 1bbff054090a6b3824d6f9ef9fe62be98f0b31fe URL: https://source.winehq.org/git/tools.git/?a=commit;h=1bbff054090a6b3824d6f9ef...
Author: Francois Gouget fgouget@codeweavers.com Date: Tue May 31 19:15:49 2022 +0200
testbot/orm: Don't assume that key columns don't need conversion.
This allows using booleans and timestamps in the key columns. It also makes GetUpdateData() consistent with GetInsertData().
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
testbot/lib/ObjectModel/DBIBackEnd.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/testbot/lib/ObjectModel/DBIBackEnd.pm b/testbot/lib/ObjectModel/DBIBackEnd.pm index 94e4be6..940d37f 100644 --- a/testbot/lib/ObjectModel/DBIBackEnd.pm +++ b/testbot/lib/ObjectModel/DBIBackEnd.pm @@ -619,7 +619,7 @@ sub GetUpdateData($$$) { foreach my $ColName (@{$PropertyDescriptor->GetColNames()}) { - push @Data, $Item->GetColValue($ColName); + push @Data, $self->ToDb($Item->GetColValue($ColName), $PropertyDescriptor); } } } @@ -663,6 +663,7 @@ sub SaveCollection($$) die "Sequence property spans multiple columns"; }
+ # No FromDb() conversion needed for integers $Item->PutColValue(@{$ColNames}[0], $Db->{'mysql_insertid'}); $Collection->KeyChanged($Key, $Item->GetKey()); }