Skip to content

Commit

Permalink
Resolve ambiguity in SQL query
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 11, 2024
1 parent 3608db7 commit 7d6bc8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Cavil/Model/Snippets.pm
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ sub unclassified ($self, $options) {
my $before = '';
if ($options->{before} > 0) {
my $quoted = $db->dbh->quote($options->{before});
$before = "AND id < $quoted";
$before = "AND s.id < $quoted";
}

my $confidence = '';
Expand Down Expand Up @@ -108,7 +108,7 @@ sub unclassified ($self, $options) {
my $snippets = $db->query(
"SELECT s.*, bp.embargoed, COUNT(*) OVER() AS total
FROM snippets s LEFT JOIN bot_packages bp ON (bp.id = s.package)
WHERE $is_approved AND $is_classified $before $legal $confidence $timeframe ORDER BY id DESC LIMIT 10"
WHERE $is_approved AND $is_classified $before $legal $confidence $timeframe ORDER BY s.id DESC LIMIT 10"
)->hashes;

my $total = 0;
Expand Down

0 comments on commit 7d6bc8d

Please sign in to comment.