Description:
When running ndb_size.pl against any (or all) dbs on localhost or a remote host I get the following error:
Can't use string ("9/16") as a HASH ref while "strict refs" in use at ndb_size.pl line 920.
The same thing was happening with the Debian default version of ndb_size.pl (the version that came with 5.0.51) with a different line number.
The code that is failing is in the following block:
foreach my $i(@show_indexes)
{
$indexes{${%$i}{Key_name}}= {
type=>${%$i}{Index_type},
unique=>!${%$i}{Non_unique},
comment=>${%$i}{Comment},
} if !defined($indexes{${%$i}{Key_name}}); # this is the line it reports
$indexes{${%$i}{Key_name}}{columns}[${%$i}{Seq_in_index}-1]=
${%$i}{Column_name};
}
Using Data::Dumper to print the value of $i at the start of the block shows me:
$VAR1 = {
'Index_type' => 'BTREE',
'Packed' => undef,
'Cardinality' => '2',
'Non_unique' => '0',
'Comment' => '',
'Sub_part' => undef,
'Column_name' => 'id',
'Table' => 'address_type',
'Key_name' => 'PRIMARY',
'Null' => '',
'Seq_in_index' => '1',
'Collation' => 'A'
};
which tells me that the data is actually making it there, but something in that block is failing.
output of mysql --version on the server:
:~$ mysql --version
mysql Ver 14.12 Distrib 5.0.32, for pc-linux-gnu (i486) using readline 5.2
and on the localhost:
:~$ mysql --version
mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (i486) using readline 5.2
output of perl --version:
:~$ perl --version
This is perl, v5.10.0 built for i486-linux-gnu-thread-multi
Copyright 1987-2007, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
versions of ndb_size.pl tried:
Debian version that came with 5.0.51, identical to Debian version that came with 5.0.32, fresh version from 5.1.44 source code download from today.
How to repeat:
perl ndb_size.pl ALL --hostname=dbserv01 --user=XXredactedXX --password=XXredactedXX --excludedbs=bad_db1,bad_db2,mysql,mysql_ny