Subject: | Caching prepared statements does not work for the first query executed |
Due to this bit:
if (my $i = (grep $old->[$_][0] eq $query, 0..$#$old)[0]) {
returning an index of 0 for the very first executed query, which
evaluates to false, that cached statement handle is always ignored.
Worse, due to any subsequent queries matching the 0th one, they won't be
cached.
As such the first query is never cached.