[Koha-bugs] [Bug 28267] Older databases fail to upgrade due to having a row format other than "DYNAMIC"

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Jan 23 07:01:40 CET 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28267

--- Comment #47 from David Cook <dcook at prosentient.com.au> ---
(In reply to Marcel de Rooy from comment #43)
> +        my $sth = $dbh->prepare($sql);
> +        $sth->execute($database);
> +        my $row = $sth->fetchrow_arrayref;
> +        my $count = $row->[0];
> +        if ($count){
> +            $result{count} = $count;
> +        }
> Why do you test $count here? And why not shorter like : $result{count} =
> $dbh->selectrow_arrayref->[0] ?

I think there's a mistake in that selectrow_arrayref syntax, but overall yeah
that could be used instead.

The trio of statements is habit/the usual practice in Koha I think.

As for testing $count... that's also habit. I usually test return values,
although I think you could argue in this case that it would be better not to
test $count.

It's a simple change, so I just "did the usual". 

> +    $schema->storage->txn_begin;
> +    my $dbh = C4::Context->dbh;
> +    $dbh->do("ALTER TABLE tags row_format=COMPACT;");
> 
> False idea of security? The txn cant have an ALTER TABLE, right?

The txn can contain the ALTER TABLE, but I don't think rolling back does
anything. I think the commit happens implicitly behind the scenes.

The txn_begin bit is copy/pasted from other tests.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list