diff options
| author | khoff <khoff> | 2005-04-06 00:50:36 +0000 | 
|---|---|---|
| committer | khoff <khoff> | 2005-04-06 00:50:36 +0000 | 
| commit | 52c6b069246af5ca57d44287b542a3d8b5b78e70 (patch) | |
| tree | 1a2c03e6fc40adac9711c65606c66f01167fd6e4 /FS | |
| parent | f3fb71c65b7ba053e1e28f3cff45bc2ca9856da1 (diff) | |
$pkey should be the primary key of the real table, not the history table.
Diffstat (limited to 'FS')
| -rw-r--r-- | FS/FS/h_Common.pm | 5 | 
1 files changed, 3 insertions, 2 deletions
| diff --git a/FS/FS/h_Common.pm b/FS/FS/h_Common.pm index e575cffdb..d55da8cfb 100644 --- a/FS/FS/h_Common.pm +++ b/FS/FS/h_Common.pm @@ -40,8 +40,9 @@ sub sql_h_search {    my( $self, $end ) = ( shift, shift );    my $table = $self->table; -  my $pkey = dbdef->table($table)->primary_key -    or die "can't (yet) search history table $table without a primary key"; +  my $real_table = ($table =~ /^h_(.*)$/) ? $1 : $table; +  my $pkey = dbdef->table($real_table)->primary_key +    or die "can't (yet) search history table $real_table without a primary key";    unless ($end) {      confess 'Called sql_h_search without END_TIMESTAMP'; | 
