]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/thread-index-gap: support older DBI
authorEric Wong <e@yhbt.net>
Sun, 17 Jan 2021 07:09:57 +0000 (07:09 +0000)
committerEric Wong <e@80x24.org>
Mon, 18 Jan 2021 09:25:11 +0000 (09:25 +0000)
...by avoiding selectall_array in favor of selectall_arrayref.
Tested with DBI 1.627.

t/thread-index-gap.t

index f4e4bd09c3ad3228519e6565be9e78bd09f63df6..83c3707d21d795e55d7023ea67fcedee027524cf 100644 (file)
@@ -45,12 +45,15 @@ for my $msgs (['orig', reverse @msgs], ['shuffle', shuffle(@msgs)]) {
        }
        $im->done;
        my $over = $ibx->over;
-       my @tid = $over->dbh->selectall_array('SELECT DISTINCT(tid) FROM over');
+       my $dbh = $over->dbh;
+       my $tid = $dbh->selectall_arrayref('SELECT DISTINCT(tid) FROM over');
+       my @tid = map { $_->[0] } @$tid;
        is(scalar(@tid), 1, "only one thread initially ($desc)");
        $over->dbh_close;
        run_script([qw(-index --reindex --rethread), $ibx->{inboxdir}]) or
                BAIL_OUT 'rethread';
-       @tid = $over->dbh->selectall_array('SELECT DISTINCT(tid) FROM over');
+       $tid = $dbh->selectall_arrayref('SELECT DISTINCT(tid) FROM over');
+       @tid = map { $_->[0] } @$tid;
        is(scalar(@tid), 1, "only one thread after rethread ($desc)");
 }