Below is the list of changes that have just been committed into a local
5.1 repository of mtaylor. When mtaylor 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@stripped, 2007-05-25 10:58:51-07:00, mtaylor@qualinost.(none) +1 -0
Made database an optional parameter, the exclusion of which causes all databases to be
examined.
If selecting from information_schema fails, attempt to fall back to show tables from
storage/ndb/tools/ndb_size.pl@stripped, 2007-05-25 10:58:47-07:00, mtaylor@qualinost.(none)
+21 -8
Made database an optional parameter, the exclusion of which causes all databases to be
examined.
If selecting from information_schema fails, attempt to fall back to show tables from
# 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: mtaylor
# Host: qualinost.(none)
# Root: /home/mtaylor/src/mysql/mysql-5.1-new-maint
--- 1.10/storage/ndb/tools/ndb_size.pl 2007-05-25 10:59:05 -07:00
+++ 1.11/storage/ndb/tools/ndb_size.pl 2007-05-25 10:59:05 -07:00
@@ -409,7 +409,7 @@
my $report= new MySQL::NDB::Size::Report;
-if($help || !$database)
+if($help)
{
print STDERR "Usage:\n";
print STDERR "\tndb_size.pl --database=<db name>|ALL [--hostname=<host>]"
@@ -428,15 +428,16 @@
exit(1);
}
+
$hostname= 'localhost' unless $hostname;
my %queries; # used for loadqueries/savequeries
-
my $withdb="";
+
$excludedbs||="";
$excludetables||="";
-if ($database ne "ALL") {
+if ($database) {
my @dbs = split(',',$database);
$database=$dbs[0];
$withdb = join("','",@dbs);
@@ -446,10 +447,10 @@
if(!$loadqueries)
{
my $dsn;
- if ($database eq "ALL") {
- $dsn = "DBI:mysql:host=$hostname";
- } else {
+ if ($database) {
$dsn = "DBI:mysql:database=$database;host=$hostname";
+ } else {
+ $dsn = "DBI:mysql:host=$hostname";
}
$dbh= DBI->connect($dsn, $user, $password) or exit(1);
$report->database($database);
@@ -486,6 +487,15 @@
$excludetables=" and t.TABLE_NAME not in ('$excludetables') ";
}
$tables= $dbh->selectall_arrayref("select t.TABLE_NAME,t.TABLE_SCHEMA from
information_schema.TABLES t where t.TABLE_SCHEMA!='mysql' and
t.TABLE_SCHEMA!='information_schema' $excludedbs $excludetables $withdb");
+ if (!$tables) {
+ print "WARNING: problem with selecing from INFORMATION SCHEMA\n";
+ if ($database) {
+ print "\t attempting to fallback to show tables from $database";
+ $tables= $dbh->selectall_arrayref("show tables from $database\n");
+ } else {
+ print "All Databases not supported in 4.1. Please specify --database=\n";
+ }
+ }
$queries{"show tables"}= $tables;
}
@@ -779,7 +789,10 @@
row_ddm_overhead =>
{ '5.1' => 8 },
);
-
+# FIXME - There is a bug here where if we set the table name in the created
+# table to the index name, it won't be able to select the column info out,
+# but if we set it to the table, then it will set the table into the report
+# on the same key as the parent table.
do_table($st,
\%idxcols,
{
@@ -800,7 +813,7 @@
foreach(@{$tables})
{
my $table= @{$_}[0];
- my $schema = @{$_}[1];
+ my $schema = @{$_}[1] || $database;
my $info;
{
my $sql= 'describe `'.$schema.'`.`'.$table.'`';
| Thread |
|---|
| • bk commit into 5.1 tree (mtaylor:1.2506) | Monty Taylor | 25 May |