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

--- Comment #47 from David Cook <[email protected]> ---
(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.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to