3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-24 11:42:35 +01:00

DualIndexSQLiteObject: do not return partially cached object for get_data(x, y)

This commit is contained in:
Pragmatic Software 2020-03-19 18:03:35 -07:00
parent 5e2dfff2cc
commit 9ad611dd60

View File

@ -493,16 +493,6 @@ sub get_data {
}
}
if (grep { $_ ne '_name' } keys %{$self->{cache}->{$lc_index1}->{$lc_index2}}) {
my $d = {};
foreach my $key (keys %{$self->{cache}->{$lc_index1}->{$lc_index2}}) {
if (defined $self->{cache}->{$lc_index1}->{$lc_index2}->{$key}) {
$d->{$key} = $self->{cache}->{$lc_index1}->{$lc_index2}->{$key};
}
}
return $d;
}
my $data = eval {
my $sth = $self->{dbh}->prepare('SELECT * FROM Stuff WHERE index1 = ? AND index2 = ?');
$sth->execute($index1, $index2);