List:Internals« Previous MessageNext Message »
From:Stewart Smith Date:September 14 2005 6:28am
Subject:bk commit into 4.1 tree (stewart:1.2422)
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of stewart. When stewart does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2422 05/09/14 16:28:19 stewart@stripped +1 -0
  WL#2779 ndb_size.pl
  
  Bug reported by Adam Dixon - table name needs quoting.

  ndb/tools/ndb_size.pl
    1.2 05/09/14 16:28:16 stewart@stripped +7 -4
    Always quote the table and database names when sending to cluster.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	stewart
# Host:	willster.(none)
# Root:	/home/stewart/Documents/MySQL/4.1/wl2779

--- 1.1/ndb/tools/ndb_size.pl	2005-09-12 15:54:19 +10:00
+++ 1.2/ndb/tools/ndb_size.pl	2005-09-14 16:28:16 +10:00
@@ -68,8 +68,9 @@
 {
     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 @@
 	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 @@
     # 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)
 	{    
Thread
bk commit into 4.1 tree (stewart:1.2422)Stewart Smith14 Sep