warn "# $rows rows get_username_table $workload\n";
+ $rows = $sth->fetchall_arrayref;
+ my @columns = @{ $sth->{NAME} };
+
+ # decode hash column
+ my $hash_col;
+ foreach ( 0 .. $#columns ) {
+ $hash_col = $_ if $columns[$_] eq 'h';
+ }
+ if ( defined $hash_col ) {
+ map {
+ my $hash = $_->[$hash_col];
+ $hash =~ s/\@/\\\@/g;
+ $_->[$hash_col] = eval "{ $hash }";
+ $_->[$hash_col] = "ERROR: $@ for $hash" if $@;
+ } @$rows
+ }
+
return {
- columns => $sth->{NAME},
- rows => $sth->fetchall_arrayref,
+ columns => \@columns,
+ rows => $rows,
+ hash_col => $hash_col,
};
}