ReadOnly => !$writable,
sqlite_use_immediate_transaction => 1,
});
- $dbh->do('PRAGMA case_sensitive_like = ON');
$dbh;
}
($min, $sth->fetchrow_array);
}
-sub mid_prefixes {
- my ($self, $pfx, $limit) = @_;
-
- die "No prefix given" unless (defined $pfx && $pfx ne '');
- $pfx =~ s/([%_])/\\$1/g;
- $pfx .= '%';
-
- $limit ||= 100;
- $limit += 0; # force to integer
- $limit ||= 100;
-
- $self->{dbh}->selectcol_arrayref('SELECT mid FROM msgmap ' .
- 'WHERE mid LIKE ? ESCAPE ? ' .
- "ORDER BY num DESC LIMIT $limit",
- undef, $pfx, '\\');
-}
-
sub mid_delete {
my ($self, $mid) = @_;
my $dbh = $self->{dbh};
my $attr = { Columns => [] };
my $mids = $dbh->selectall_arrayref(<<'', $attr, $$beg, $end);
SELECT num,mid FROM msgmap WHERE num >= ? AND num <= ?
-ORDER BY num ASC
+ORDER BY num ASC LIMIT 1000
$$beg = $mids->[-1]->[0] + 1 if @$mids;
$mids