summaryrefslogtreecommitdiff
path: root/ndb/tools
diff options
context:
space:
mode:
authorunknown <stewart@mysql.com>2005-09-14 16:28:19 +1000
committerunknown <stewart@mysql.com>2005-09-14 16:28:19 +1000
commitda5ffc732cae26712a504874e4c4f3f60309d4a4 (patch)
tree0cfa389c5723d11ecd693ab52f86813a02559c59 /ndb/tools
parentf28e81d03e28d6260d3cb89d13ef31e0cd9a3888 (diff)
downloadmariadb-git-da5ffc732cae26712a504874e4c4f3f60309d4a4.tar.gz
WL#2779 ndb_size.pl
Bug reported by Adam Dixon - table name needs quoting. ndb/tools/ndb_size.pl: Always quote the table and database names when sending to cluster.
Diffstat (limited to 'ndb/tools')
-rw-r--r--ndb/tools/ndb_size.pl11
1 files changed, 7 insertions, 4 deletions
diff --git a/ndb/tools/ndb_size.pl b/ndb/tools/ndb_size.pl
index 92ecf5ca784..64a20423636 100644
--- a/ndb/tools/ndb_size.pl
+++ b/ndb/tools/ndb_size.pl
@@ -68,8 +68,9 @@ foreach(@{$tables})
{
my $table= @{$_}[0];
my @columns;
- my $info= $dbh->selectall_hashref("describe $table","Field");
- my @count = $dbh->selectrow_array("select count(*) from $table");
+ my $info= $dbh->selectall_hashref("describe ".$dbh->quote($table),"Field");
+ my @count = $dbh->selectrow_array("select count(*) from "
+ .$dbh->quote($table));
my %columnsize; # used for index calculations
# We now work out the DataMemory usage
@@ -129,7 +130,9 @@ foreach(@{$tables})
elsif($type =~ /varchar/ || $type =~ /varbinary/)
{
my $fixed= 1+$size;
- my @dynamic=$dbh->selectrow_array("select avg(length($name)) from $table");
+ my @dynamic=$dbh->selectrow_array("select avg(length("
+ .$dbh->quote($name)
+ .")) from ".$dbh->quote($table));
$dynamic[0]=0 if !$dynamic[0];
@realsize= ($fixed,$fixed,ceil($dynamic[0]));
}
@@ -163,7 +166,7 @@ foreach(@{$tables})
# we can still connect to pre-5.0 mysqlds.
my %indexes;
{
- my $sth= $dbh->prepare("show index from $table");
+ my $sth= $dbh->prepare("show index from "$dbh->quote($table));
$sth->execute;
while(my $i = $sth->fetchrow_hashref)
{