So far, searching by size has never been publicly documented,
and IMHO, of questionable utility. In any case, "z:" is what
mairix(1) uses, so it may be familiar to existing mairix users
(I've never used this prefix myself).
So far, this prefix is only used internally in tests and in
auto-translated queries from IMAP; thus this incompatible change
is unlikely to affect anyone.
# things that should not match
sub impossible {
my ($self) = @_;
# things that should not match
sub impossible {
my ($self) = @_;
- push @{$self->{xap}}, 'bytes:..0';
+ push @{$self->{xap}}, 'z:..0';
my $sql = $self->{sql} or return 1;
$$sql .= ' AND num < 0';
}
my $sql = $self->{sql} or return 1;
$$sql .= ' AND num < 0';
}
MSN_set : sequence_set { $q->msn_set($item{sequence_set}) }
UID_set : "UID" sequence_set { $q->uid_set($item{sequence_set}) }
MSN_set : sequence_set { $q->msn_set($item{sequence_set}) }
UID_set : "UID" sequence_set { $q->uid_set($item{sequence_set}) }
-LARGER_number : "LARGER" number { $q->xap_only("bytes:$item{number}..") }
-SMALLER_number : "SMALLER" number { $q->xap_only("bytes:..$item{number}") }
+LARGER_number : "LARGER" number { $q->xap_only("z:$item{number}..") }
+SMALLER_number : "SMALLER" number { $q->xap_only("z:..$item{number}") }
DELETED : "DELETED" { $q->impossible }
OLD : "OLD" { $q->impossible }
DELETED : "DELETED" { $q->impossible }
OLD : "OLD" { $q->impossible }
my ($self, $qstr, $opt) = @_;
$opt //= {};
$opt->{relevance} //= -2;
my ($self, $qstr, $opt) = @_;
$opt //= {};
$opt->{relevance} //= -2;
- $self->mset($qstr //= 'bytes:1..', $opt);
+ $self->mset($qstr //= 'z:1..', $opt);
$cb->($qp, $NVRP->new(DT, 'dt:'));
# for IMAP, undocumented for WWW and may be split off go away
$cb->($qp, $NVRP->new(DT, 'dt:'));
# for IMAP, undocumented for WWW and may be split off go away
- $cb->($qp, $NVRP->new(BYTES, 'bytes:'));
+ $cb->($qp, $NVRP->new(BYTES, 'z:'));
$cb->($qp, $NVRP->new(TS, 'rt:'));
$cb->($qp, $NVRP->new(UID, 'uid:'));
$cb->($qp, $NVRP->new(TS, 'rt:'));
$cb->($qp, $NVRP->new(UID, 'uid:'));
pipe(my ($r, $w)) or BAIL_OUT $!;
open my $err, '+>', undef or BAIL_OUT $!;
my $opt = { run_mode => 0, 1 => $w, 2 => $err };
pipe(my ($r, $w)) or BAIL_OUT $!;
open my $err, '+>', undef or BAIL_OUT $!;
my $opt = { run_mode => 0, 1 => $w, 2 => $err };
- my $cmd = [qw(lei q -qt), @$out, 'bytes:1..'];
+ my $cmd = [qw(lei q -qt), @$out, 'z:1..'];
my $tp = start_script($cmd, undef, $opt);
close $w;
sysread($r, my $buf, 1);
my $tp = start_script($cmd, undef, $opt);
close $w;
sysread($r, my $buf, 1);
my $host_port = tcp_host_port($sock);
undef $sock;
test_lei({ tmpdir => $tmpdir }, sub {
my $host_port = tcp_host_port($sock);
undef $sock;
test_lei({ tmpdir => $tmpdir }, sub {
- lei_ok(qw(q bytes:1..));
my $out = json_utf8->decode($lei_out);
is_deeply($out, [ undef ], 'nothing imported, yet');
lei_ok('import', "imap://$host_port/t.v2.0");
my $out = json_utf8->decode($lei_out);
is_deeply($out, [ undef ], 'nothing imported, yet');
lei_ok('import', "imap://$host_port/t.v2.0");
- lei_ok(qw(q bytes:1..));
$out = json_utf8->decode($lei_out);
ok(scalar(@$out) > 1, 'got imported messages');
is(pop @$out, undef, 'trailing JSON null element was null');
$out = json_utf8->decode($lei_out);
ok(scalar(@$out) > 1, 'got imported messages');
is(pop @$out, undef, 'trailing JSON null element was null');
my $host_port = tcp_host_port($sock);
undef $sock;
test_lei({ tmpdir => $tmpdir }, sub {
my $host_port = tcp_host_port($sock);
undef $sock;
test_lei({ tmpdir => $tmpdir }, sub {
- lei_ok(qw(q bytes:1..));
my $out = json_utf8->decode($lei_out);
is_deeply($out, [ undef ], 'nothing imported, yet');
lei_ok('import', "nntp://$host_port/t.v2");
diag $lei_err;
my $out = json_utf8->decode($lei_out);
is_deeply($out, [ undef ], 'nothing imported, yet');
lei_ok('import', "nntp://$host_port/t.v2");
diag $lei_err;
- lei_ok(qw(q bytes:1..));
diag $lei_err;
$out = json_utf8->decode($lei_out);
ok(scalar(@$out) > 1, 'got imported messages');
diag $lei_err;
$out = json_utf8->decode($lei_out);
ok(scalar(@$out) > 1, 'got imported messages');
pipe(my ($r, $w)) or BAIL_OUT $!;
open my $err, '+>', undef or BAIL_OUT $!;
my $opt = { run_mode => 0, 1 => $w, 2 => $err };
pipe(my ($r, $w)) or BAIL_OUT $!;
open my $err, '+>', undef or BAIL_OUT $!;
my $opt = { run_mode => 0, 1 => $w, 2 => $err };
- my $cmd = [qw(lei q -q -t), @$out, 'bytes:1..'];
+ my $cmd = [qw(lei q -q -t), @$out, 'z:1..'];
my $tp = start_script($cmd, $env, $opt);
close $w;
sysread($r, my $buf, 1);
my $tp = start_script($cmd, $env, $opt);
close $w;
sysread($r, my $buf, 1);