BUG#28253 ndb_size.pl: cannot set socket Index: ndb-work/storage/ndb/tools/ndb_size.pl =================================================================== --- ndb-work.orig/storage/ndb/tools/ndb_size.pl 2007-07-06 15:39:21.423605146 +1000 +++ ndb-work/storage/ndb/tools/ndb_size.pl 2007-07-06 15:45:37.389030194 +1000 @@ -391,10 +391,11 @@ sub compute_estimate package main; -my ($dbh,$database,$hostname,$user,$password,$help,$savequeries,$loadqueries,$debug,$format); +my ($dbh,$database,$socket,$hostname,$user,$password,$help,$savequeries,$loadqueries,$debug,$format); GetOptions('database|d=s'=>\$database, 'hostname=s'=>\$hostname, + 'socket=s'=>\$socket, 'user|u=s'=>\$user, 'password|p=s'=>\$password, 'savequeries|s=s'=>\$savequeries, @@ -409,7 +410,8 @@ my $report= new MySQL::NDB::Size::Report if($help || !$database) { print STDERR "Usage:\n"; - print STDERR "\tndb_size.pl --database= [--hostname=]" + print STDERR "\tndb_size.pl --database= [--hostname=] " + ."[--socket=] " ."[--user=] [--password=] [--help|-h] [--format=(html|text)] [--loadqueries=] [--savequeries=]\n\n"; print STDERR "\t--hostname=: can be used to designate a " ."specific port\n"; @@ -428,6 +430,7 @@ my %queries; # used for loadqueries/save if(!$loadqueries) { my $dsn = "DBI:mysql:database=$database;host=$hostname"; + $dsn.= ";mysql_socket=$socket" if ($socket); $dbh= DBI->connect($dsn, $user, $password) or exit(1); $report->database($database); $report->dsn($dsn); @@ -976,6 +979,8 @@ if($debug) eval 'print STDERR Dumper($report)'; } +$format= "text" unless $format; + if($format eq 'text') { my $text_out= new MySQL::NDB::Size::Output::Text($report); @@ -986,12 +991,6 @@ elsif($format eq 'html') my $html_out= new MySQL::NDB::Size::Output::HTML($report); $html_out->output(); } -else -{ - # default to text output - my $text_out= new MySQL::NDB::Size::Output::Text($report); - $text_out->output(); -} package MySQL::NDB::Size::Output::Text; use Data::Dumper;