diff options
author | unknown <stewart@flamingspork.com[stewart]> | 2007-08-15 12:12:59 +1000 |
---|---|---|
committer | unknown <stewart@flamingspork.com[stewart]> | 2007-08-15 12:12:59 +1000 |
commit | b0ac87dc443f4b7b704d49f906f7673562541352 (patch) | |
tree | 0d0af4d9e0f00c5c43c1f4530d1976ba9cdb2314 /storage/ndb/tools | |
parent | 71a1f16014d7164e94582abe640aca07a060d37a (diff) | |
download | mariadb-git-b0ac87dc443f4b7b704d49f906f7673562541352.tar.gz |
[PATCH] BUG#28253 ndb_size.pl: cannot set socket
Index: ndb-work/storage/ndb/tools/ndb_size.pl
===================================================================
storage/ndb/tools/ndb_size.pl:
BUG#28253 ndb_size.pl: cannot set socket
Diffstat (limited to 'storage/ndb/tools')
-rw-r--r-- | storage/ndb/tools/ndb_size.pl | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/storage/ndb/tools/ndb_size.pl b/storage/ndb/tools/ndb_size.pl index 8f6395443ba..3537a9e8490 100644 --- a/storage/ndb/tools/ndb_size.pl +++ b/storage/ndb/tools/ndb_size.pl @@ -403,10 +403,24 @@ sub compute_estimate package main; -my ($dbh,$database,$hostname,$user,$password,$help,$savequeries,$loadqueries,$debug,$format,$excludetables,$excludedbs); +my ($dbh, + $database, + $socket, + $hostname, + $user, + $password); + +my ($help, + $savequeries, + $loadqueries, + $debug, + $format, + $excludetables, + $excludedbs); GetOptions('database|d=s'=>\$database, 'hostname=s'=>\$hostname, + 'socket=s'=>\$socket, 'user|u=s'=>\$user, 'password|p=s'=>\$password, 'savequeries|s=s'=>\$savequeries, @@ -423,7 +437,8 @@ my $report= new MySQL::NDB::Size::Report; if($help) { print STDERR "Usage:\n"; - print STDERR "\tndb_size.pl --database=<db name>|ALL [--hostname=<host>]" + print STDERR "\tndb_size.pl --database=<db name>|ALL [--hostname=<host>] " + ."[--socket=<socket>] " ."[--user=<user>] [--password=<password>] [--help|-h] [--format=(html|text)] [--loadqueries=<file>] [--savequeries=<file>]\n\n"; print STDERR "\t--database=<db name> ALL may be specified to examine all " ."databases\n"; @@ -447,6 +462,7 @@ my %queries; # used for loadqueries/savequeries if(!$loadqueries) { my $dsn = "DBI:mysql:host=$hostname"; + $dsn.= ";mysql_socket=$socket" if ($socket); $dbh= DBI->connect($dsn, $user, $password) or exit(1); $report->dsn($dsn); } @@ -1057,6 +1073,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); @@ -1067,12 +1085,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; |