summaryrefslogtreecommitdiff
path: root/ndb/tools
diff options
context:
space:
mode:
authorunknown <hartmut@mysql.com>2005-09-30 18:16:57 +0200
committerunknown <hartmut@mysql.com>2005-09-30 18:16:57 +0200
commit7d3c939e81f8da8c9f57421864e07b4315f03f57 (patch)
treee8f6638a94b8cca6df059c2a836b5b37761c6195 /ndb/tools
parent0585fcbe639000fa9e4210e2a4149570268f8a72 (diff)
parent39ba8376e6a3331a2c75fb3f9f5fbd6ff42f6a62 (diff)
downloadmariadb-git-7d3c939e81f8da8c9f57421864e07b4315f03f57.tar.gz
Merge hholzgraefe@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/hartmut/projects/mysql/dev/5.0 ndb/tools/ndb_config.cpp: Auto merged
Diffstat (limited to 'ndb/tools')
-rw-r--r--ndb/tools/ndb_config.cpp175
-rw-r--r--ndb/tools/ndb_size.pl263
-rw-r--r--ndb/tools/ndb_size.tmpl175
-rw-r--r--ndb/tools/restore/consumer_restore.cpp2
4 files changed, 556 insertions, 59 deletions
diff --git a/ndb/tools/ndb_config.cpp b/ndb/tools/ndb_config.cpp
index 290dd440479..1b9a771f243 100644
--- a/ndb/tools/ndb_config.cpp
+++ b/ndb/tools/ndb_config.cpp
@@ -42,6 +42,8 @@ static const char * g_type = 0;
static const char * g_host = 0;
static const char * g_field_delimiter=",";
static const char * g_row_delimiter=" ";
+static const char * g_config_file = 0;
+static int g_mycnf = 0;
int g_print_full_config, opt_ndb_shm;
my_bool opt_core;
@@ -92,6 +94,12 @@ static struct my_option my_long_options[] =
{ "rows", 'r', "Row separator",
(gptr*) &g_row_delimiter, (gptr*) &g_row_delimiter,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ { "config-file", 256, "Path to config.ini",
+ (gptr*) &g_config_file, (gptr*) &g_config_file,
+ 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ { "mycnf", 256, "Read config from my.cnf",
+ (gptr*) &g_mycnf, (gptr*) &g_mycnf,
+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -126,7 +134,7 @@ struct Match
{
int m_key;
BaseString m_value;
- virtual int eval(NdbMgmHandle, const Iter&);
+ virtual int eval(const Iter&);
};
struct HostMatch : public Match
@@ -139,18 +147,21 @@ struct Apply
Apply() {}
Apply(int val) { m_key = val;}
int m_key;
- virtual int apply(NdbMgmHandle, const Iter&);
+ virtual int apply(const Iter&);
};
struct NodeTypeApply : public Apply
{
- virtual int apply(NdbMgmHandle, const Iter&);
+ virtual int apply(const Iter&);
};
static int parse_query(Vector<Apply*>&, int &argc, char**& argv);
static int parse_where(Vector<Match*>&, int &argc, char**& argv);
-static int eval(NdbMgmHandle, const Iter&, const Vector<Match*>&);
-static int apply(NdbMgmHandle, const Iter&, const Vector<Apply*>&);
+static int eval(const Iter&, const Vector<Match*>&);
+static int apply(const Iter&, const Vector<Apply*>&);
+static ndb_mgm_configuration* fetch_configuration();
+static ndb_mgm_configuration* load_configuration();
+
int
main(int argc, char** argv){
NDB_INIT(argv[0]);
@@ -161,51 +172,16 @@ main(int argc, char** argv){
ndb_std_get_one_option)))
return -1;
- NdbMgmHandle mgm = ndb_mgm_create_handle();
- if(mgm == NULL) {
- fprintf(stderr, "Cannot create handle to management server.\n");
- exit(-1);
- }
+ ndb_mgm_configuration * conf = 0;
- ndb_mgm_set_error_stream(mgm, stderr);
-
- if (ndb_mgm_set_connectstring(mgm, g_connectstring))
- {
- fprintf(stderr, "* %5d: %s\n",
- ndb_mgm_get_latest_error(mgm),
- ndb_mgm_get_latest_error_msg(mgm));
- fprintf(stderr,
- "* %s", ndb_mgm_get_latest_error_desc(mgm));
- exit(-1);
- }
+ if (g_config_file || g_mycnf)
+ conf = load_configuration();
+ else
+ conf = fetch_configuration();
- if(ndb_mgm_connect(mgm, try_reconnect-1, 5, 1))
+ if (conf == 0)
{
- fprintf(stderr, "Connect failed");
- fprintf(stderr, " code: %d, msg: %s\n",
- ndb_mgm_get_latest_error(mgm),
- ndb_mgm_get_latest_error_msg(mgm));
- exit(-1);
- }
- else if(g_verbose)
- {
- fprintf(stderr, "Connected to %s:%d\n",
- ndb_mgm_get_connected_host(mgm),
- ndb_mgm_get_connected_port(mgm));
- }
-
- ndb_mgm_configuration * conf = ndb_mgm_get_configuration(mgm, 0);
- if(conf == 0)
- {
- fprintf(stderr, "Could not get configuration");
- fprintf(stderr, "code: %d, msg: %s\n",
- ndb_mgm_get_latest_error(mgm),
- ndb_mgm_get_latest_error_msg(mgm));
- exit(-1);
- }
- else if(g_verbose)
- {
- fprintf(stderr, "Fetched configuration\n");
+ return -1;
}
Vector<Apply*> select_list;
@@ -231,12 +207,12 @@ main(int argc, char** argv){
iter.first();
for(iter.first(); iter.valid(); iter.next())
{
- if(eval(mgm, iter, where_clause))
+ if(eval(iter, where_clause))
{
if(prev)
printf("%s", g_row_delimiter);
prev= true;
- apply(mgm, iter, select_list);
+ apply(iter, select_list);
}
}
printf("\n");
@@ -331,11 +307,11 @@ template class Vector<Match*>;
static
int
-eval(NdbMgmHandle mgm, const Iter& iter, const Vector<Match*>& where)
+eval(const Iter& iter, const Vector<Match*>& where)
{
for(unsigned i = 0; i<where.size(); i++)
{
- if(where[i]->eval(mgm, iter) == 0)
+ if(where[i]->eval(iter) == 0)
return 0;
}
@@ -344,11 +320,11 @@ eval(NdbMgmHandle mgm, const Iter& iter, const Vector<Match*>& where)
static
int
-apply(NdbMgmHandle mgm, const Iter& iter, const Vector<Apply*>& list)
+apply(const Iter& iter, const Vector<Apply*>& list)
{
for(unsigned i = 0; i<list.size(); i++)
{
- list[i]->apply(mgm, iter);
+ list[i]->apply(iter);
if(i + 1 != list.size())
printf("%s", g_field_delimiter);
}
@@ -356,19 +332,19 @@ apply(NdbMgmHandle mgm, const Iter& iter, const Vector<Apply*>& list)
}
int
-Match::eval(NdbMgmHandle h, const Iter& iter)
+Match::eval(const Iter& iter)
{
Uint32 val32;
Uint64 val64;
const char* valc;
if (iter.get(m_key, &val32) == 0)
{
- if(atoi(m_value.c_str()) != val32)
+ if(atoi(m_value.c_str()) != (int)val32)
return 0;
}
else if(iter.get(m_key, &val64) == 0)
{
- if(strtoll(m_value.c_str(), (char **)NULL, 10) != val64)
+ if(strtoll(m_value.c_str(), (char **)NULL, 10) != (long long)val64)
return 0;
}
else if(iter.get(m_key, &valc) == 0)
@@ -418,7 +394,7 @@ HostMatch::eval(NdbMgmHandle h, const Iter& iter)
}
int
-Apply::apply(NdbMgmHandle h, const Iter& iter)
+Apply::apply(const Iter& iter)
{
Uint32 val32;
Uint64 val64;
@@ -439,7 +415,7 @@ Apply::apply(NdbMgmHandle h, const Iter& iter)
}
int
-NodeTypeApply::apply(NdbMgmHandle h, const Iter& iter)
+NodeTypeApply::apply(const Iter& iter)
{
Uint32 val32;
if (iter.get(CFG_TYPE_OF_SECTION, &val32) == 0)
@@ -448,3 +424,86 @@ NodeTypeApply::apply(NdbMgmHandle h, const Iter& iter)
}
return 0;
}
+
+ndb_mgm_configuration*
+fetch_configuration()
+{
+ ndb_mgm_configuration* conf = 0;
+ NdbMgmHandle mgm = ndb_mgm_create_handle();
+ if(mgm == NULL) {
+ fprintf(stderr, "Cannot create handle to management server.\n");
+ return 0;
+ }
+
+ ndb_mgm_set_error_stream(mgm, stderr);
+
+ if (ndb_mgm_set_connectstring(mgm, g_connectstring))
+ {
+ fprintf(stderr, "* %5d: %s\n",
+ ndb_mgm_get_latest_error(mgm),
+ ndb_mgm_get_latest_error_msg(mgm));
+ fprintf(stderr,
+ "* %s", ndb_mgm_get_latest_error_desc(mgm));
+ goto noconnect;
+ }
+
+ if(ndb_mgm_connect(mgm, try_reconnect-1, 5, 1))
+ {
+ fprintf(stderr, "Connect failed");
+ fprintf(stderr, " code: %d, msg: %s\n",
+ ndb_mgm_get_latest_error(mgm),
+ ndb_mgm_get_latest_error_msg(mgm));
+ goto noconnect;
+ }
+ else if(g_verbose)
+ {
+ fprintf(stderr, "Connected to %s:%d\n",
+ ndb_mgm_get_connected_host(mgm),
+ ndb_mgm_get_connected_port(mgm));
+ }
+
+ conf = ndb_mgm_get_configuration(mgm, 0);
+ if(conf == 0)
+ {
+ fprintf(stderr, "Could not get configuration");
+ fprintf(stderr, "code: %d, msg: %s\n",
+ ndb_mgm_get_latest_error(mgm),
+ ndb_mgm_get_latest_error_msg(mgm));
+ }
+ else if(g_verbose)
+ {
+ fprintf(stderr, "Fetched configuration\n");
+ }
+
+ ndb_mgm_disconnect(mgm);
+noconnect:
+ ndb_mgm_destroy_handle(&mgm);
+
+ return conf;
+}
+
+#include <Config.hpp>
+
+ndb_mgm_configuration*
+load_configuration()
+{
+ InitConfigFileParser parser(stderr);
+ if (g_config_file)
+ {
+ if (g_verbose)
+ fprintf(stderr, "Using config.ini : %s", g_config_file);
+
+ Config* conf = parser.parseConfig(g_config_file);
+ if (conf)
+ return conf->m_configValues;
+ }
+
+ if (g_verbose)
+ fprintf(stderr, "Using my.cnf");
+
+ Config* conf = parser.parse_mycnf();
+ if (conf)
+ return conf->m_configValues;
+
+ return 0;
+}
diff --git a/ndb/tools/ndb_size.pl b/ndb/tools/ndb_size.pl
new file mode 100644
index 00000000000..64a20423636
--- /dev/null
+++ b/ndb/tools/ndb_size.pl
@@ -0,0 +1,263 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+use DBI;
+use POSIX;
+use HTML::Template;
+
+# MySQL Cluster size estimator
+# ----------------------------
+#
+# (C)2005 MySQL AB
+#
+#
+# The purpose of this tool is to work out storage requirements
+# from an existing MySQL database.
+#
+# This involves connecting to a mysql server and throwing a bunch
+# of queries at it.
+#
+# We currently estimate sizes for: 4.1, 5.0 and 5.1 to various amounts
+# of accurracy.
+#
+# There is no warranty.
+#
+# BUGS
+# ----
+# - enum/set is 0 byte storage! Woah - efficient!
+# - some float stores come out weird (when there's a comma e.g. 'float(4,1)')
+# - no disk data values
+# - computes the storage requirements of views (and probably MERGE)
+# - ignores character sets.
+
+my $template = HTML::Template->new(filename => 'ndb_size.tmpl',
+ die_on_bad_params => 0);
+
+my $dbh;
+
+{
+ my $database= $ARGV[0];
+ my $hostname= $ARGV[1];
+ my $port= $ARGV[2];
+ my $user= $ARGV[3];
+ my $password= $ARGV[4];
+ my $dsn = "DBI:mysql:database=$database;host=$hostname;port=$port";
+ $dbh= DBI->connect($dsn, $user, $password);
+ $template->param(db => $database);
+ $template->param(dsn => $dsn);
+}
+
+my @releases = ({rel=>'4.1'},{rel=>'5.0'},{rel=>'5.1'});
+$template->param(releases => \@releases);
+
+my $tables = $dbh->selectall_arrayref("show tables");
+
+my @table_size;
+
+sub align {
+ my($to,@unaligned) = @_;
+ my @aligned;
+ foreach my $x (@unaligned) {
+ push @aligned, $to * POSIX::floor(($x+$to-1)/$to);
+ }
+ return @aligned;
+}
+
+foreach(@{$tables})
+{
+ my $table= @{$_}[0];
+ my @columns;
+ 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
+
+ # sizes for 4.1, 5.0, 5.1
+ my @totalsize= (0,0,0);
+
+ foreach(keys %$info)
+ {
+ my @realsize = (0,0,0);
+ my $type;
+ my $size;
+ my $name= $_;
+
+ if($$info{$_}{Type} =~ /^(.*?)\((\d+)\)/)
+ {
+ $type= $1;
+ $size= $2;
+ }
+ else
+ {
+ $type= $$info{$_}{Type};
+ }
+
+ if($type =~ /tinyint/)
+ {@realsize=(1,1,1)}
+ elsif($type =~ /smallint/)
+ {@realsize=(2,2,2)}
+ elsif($type =~ /mediumint/)
+ {@realsize=(3,3,3)}
+ elsif($type =~ /bigint/)
+ {@realsize=(8,8,8)}
+ elsif($type =~ /int/)
+ {@realsize=(4,4,4)}
+ elsif($type =~ /float/)
+ {
+ if($size<=24)
+ {@realsize=(4,4,4)}
+ else
+ {@realsize=(8,8,8)}
+ }
+ elsif($type =~ /double/ || $type =~ /real/)
+ {@realsize=(8,8,8)}
+ elsif($type =~ /bit/)
+ {
+ my $a=($size+7)/8;
+ @realsize = ($a,$a,$a);
+ }
+ elsif($type =~ /datetime/)
+ {@realsize=(8,8,8)}
+ elsif($type =~ /timestamp/)
+ {@realsize=(4,4,4)}
+ elsif($type =~ /date/ || $type =~ /time/)
+ {@realsize=(3,3,3)}
+ elsif($type =~ /year/)
+ {@realsize=(1,1,1)}
+ elsif($type =~ /varchar/ || $type =~ /varbinary/)
+ {
+ my $fixed= 1+$size;
+ 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]));
+ }
+ elsif($type =~ /binary/ || $type =~ /char/)
+ {@realsize=($size,$size,$size)}
+ elsif($type =~ /text/ || $type =~ /blob/)
+ {@realsize=(256,256,1)} # FIXME check if 5.1 is correct
+
+ @realsize= align(4,@realsize);
+
+ $totalsize[$_]+=$realsize[$_] foreach 0..$#totalsize;
+
+ my @realout;
+ push @realout,{val=>$_} foreach @realsize;
+
+ push @columns, {
+ name=>$name,
+ type=>$type,
+ size=>$size,
+ key=>$$info{$_}{Key},
+ datamemory=>\@realout,
+ };
+
+ $columnsize{$name}= \@realsize; # used for index calculations
+ }
+
+ # And now... the IndexMemory usage.
+ #
+ # Firstly, we assemble some information about the indexes.
+ # We use SHOW INDEX instead of using INFORMATION_SCHEMA so
+ # we can still connect to pre-5.0 mysqlds.
+ my %indexes;
+ {
+ my $sth= $dbh->prepare("show index from "$dbh->quote($table));
+ $sth->execute;
+ while(my $i = $sth->fetchrow_hashref)
+ {
+ $indexes{${%$i}{Key_name}}= {
+ type=>${%$i}{Index_type},
+ unique=>!${%$i}{Non_unique},
+ comment=>${%$i}{Comment},
+ } if !defined($indexes{${%$i}{Key_name}});
+
+ $indexes{${%$i}{Key_name}}{columns}[${%$i}{Seq_in_index}-1]=
+ ${%$i}{Column_name};
+ }
+ }
+
+ if(!defined($indexes{PRIMARY})) {
+ $indexes{PRIMARY}= {
+ type=>'BTREE',
+ unique=>1,
+ comment=>'Hidden pkey created by NDB',
+ columns=>['HIDDEN_NDB_PKEY'],
+ };
+ push @columns, {
+ name=>'HIDDEN_NDB_PKEY',
+ type=>'bigint',
+ size=>8,
+ key=>'PRI',
+ datamemory=>[{val=>8},{val=>8},{val=>8}],
+ };
+ $columnsize{'HIDDEN_NDB_PKEY'}= [8,8,8];
+ }
+
+ my @IndexDataMemory= ({val=>0},{val=>0},{val=>0});
+ my @RowIndexMemory= ({val=>0},{val=>0},{val=>0});
+
+ my @indexes;
+ foreach my $index (keys %indexes) {
+ my $im41= 25;
+ $im41+=$columnsize{$_}[0] foreach @{$indexes{$index}{columns}};
+ my @im = ({val=>$im41},{val=>25},{val=>25});
+ my @dm = ({val=>10},{val=>10},{val=>10});
+ push @indexes, {
+ name=>$index,
+ type=>$indexes{$index}{type},
+ columns=>join(',',@{$indexes{$index}{columns}}),
+ indexmemory=>\@im,
+ datamemory=>\@dm,
+ };
+ $IndexDataMemory[$_]{val}+=$dm[$_]{val} foreach 0..2;
+ $RowIndexMemory[$_]{val}+=$im[$_]{val} foreach 0..2;
+ }
+
+ # total size + 16 bytes overhead
+ my @TotalDataMemory;
+ $TotalDataMemory[$_]{val}=$IndexDataMemory[$_]{val}+$totalsize[$_]+16 foreach 0..2;
+
+ my @RowDataMemory;
+ push @RowDataMemory,{val=>$_} foreach @totalsize;
+
+ my @RowPerPage;
+ push @RowPerPage,{val=>(floor((32768-128)/$TotalDataMemory[$_]{val}))} foreach 0..$#TotalDataMemory;
+
+ my @RowPerIndexPage;
+ push @RowPerIndexPage,{val=>(floor(8192/$RowIndexMemory[$_]{val}))} foreach 0..$#TotalDataMemory;
+
+ my @DataMemory;
+ push @DataMemory,{val=>ceil(($count[0]/($RowPerPage[$_]{val})))*32} foreach 0..$#RowPerPage;
+
+ my @IndexMemory;
+ push @IndexMemory,{val=>ceil(($count[0]/($RowPerIndexPage[$_]{val})))*8} foreach 0..$#RowPerPage;
+
+ my $count= $count[0];
+ my @counts;
+ $counts[$_]{val}= $count foreach 0..$#releases;
+
+ push @table_size, {
+ table=>$table,
+ indexes=>\@indexes,
+ columns=>\@columns,
+ count=>\@counts,
+ RowDataMemory=>\@RowDataMemory,
+ releases=>\@releases,
+ IndexDataMemory=>\@IndexDataMemory,
+ TotalDataMemory=>\@TotalDataMemory,
+ RowPerPage=>\@RowPerPage,
+ DataMemory=>\@DataMemory,
+ RowIndexMemory=>\@RowIndexMemory,
+ RowPerIndexPage=>\@RowPerIndexPage,
+ IndexMemory=>\@IndexMemory,
+
+ };
+}
+
+$template->param(tables => \@table_size);
+print $template->output;
diff --git a/ndb/tools/ndb_size.tmpl b/ndb/tools/ndb_size.tmpl
new file mode 100644
index 00000000000..d83d5d2c6af
--- /dev/null
+++ b/ndb/tools/ndb_size.tmpl
@@ -0,0 +1,175 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/>
+ <meta name="keywords" content="MySQL Cluster" />
+ <title>MySQL Cluster size estimate for <TMPL_VAR NAME="db" ESCAPE="HTML"></title>
+<style type="text/css">
+table { border-collapse: collapse }
+td,th { border: 1px solid black }
+</style>
+ </head>
+<body>
+<h1>MySQL Cluster analysis for <TMPL_VAR NAME="db" escape="html"></h1>
+<p>This is an automated analysis of the <TMPL_VAR NAME="DSN" escape="html"> database for migration into <a href="http://www.mysql.com/">MySQL</a> Cluster. No warranty is made to the accuracy of the information.</p>
+
+<p>This information should be valid for MySQL 4.1</p>
+
+<ul>
+<TMPL_LOOP NAME="tables">
+<li><TMPL_VAR NAME="table"></li>
+</TMPL_LOOP>
+</ul>
+
+<hr/>
+
+<TMPL_LOOP NAME="tables">
+<h2><TMPL_VAR NAME="table"></h2>
+<table>
+ <tr>
+ <th>Column</th>
+ <th>Type</th>
+ <th>Size</th>
+ <th>Key</th>
+ <TMPL_LOOP NAME=releases>
+ <th><TMPL_VAR NAME=rel> NDB Size</th>
+ </TMPL_LOOP>
+ </tr>
+ <TMPL_LOOP NAME="columns">
+ <tr>
+ <td><TMPL_VAR NAME=name></td>
+ <td><TMPL_VAR NAME=type></td>
+ <td><TMPL_VAR NAME=size></td>
+ <td><TMPL_VAR NAME=key></td>
+ <TMPL_LOOP NAME=datamemory>
+ <td><TMPL_VAR NAME=val></td>
+ </TMPL_LOOP>
+ </tr>
+ </TMPL_LOOP>
+</table>
+
+<p>&nbsp;</p>
+
+<h3>Indexes</h3>
+
+<p>We assume that indexes are ORDERED (not created USING HASH). If order is not required, 10 bytes of data memory can be saved per row if the index is created USING HASH</p>
+<table>
+<tr>
+ <th>Index</th>
+ <th>Type</th>
+ <th>Columns</th>
+ <TMPL_LOOP NAME=releases>
+ <th><TMPL_VAR NAME=rel> IdxMem</th>
+ </TMPL_LOOP>
+ <TMPL_LOOP NAME=releases>
+ <th><TMPL_VAR NAME=rel> DatMem</th>
+ </TMPL_LOOP>
+</tr>
+<TMPL_LOOP NAME="indexes">
+ <tr>
+ <td><TMPL_VAR NAME=name></td>
+ <td><TMPL_VAR NAME=type></td>
+ <td><TMPL_VAR NAME=columns></td>
+ <TMPL_LOOP NAME=indexmemory>
+ <td><TMPL_VAR NAME=val></td>
+ </TMPL_LOOP>
+ <TMPL_LOOP NAME=datamemory>
+ <td><TMPL_VAR NAME=val></td>
+ </TMPL_LOOP>
+ </tr>
+</TMPL_LOOP>
+</table>
+
+<h3>DataMemory Usage</h3>
+<table>
+<tr>
+ <th>&nbsp;</th>
+ <TMPL_LOOP NAME=releases>
+ <th><TMPL_VAR NAME=rel></th>
+ </TMPL_LOOP>
+</tr>
+<tr>
+ <th>Row Overhead</th>
+ <TMPL_LOOP NAME=releases>
+ <td>16</td>
+ </TMPL_LOOP>
+</tr>
+<tr>
+ <th>Column DataMemory/Row</th>
+ <TMPL_LOOP NAME=RowDataMemory>
+ <td><TMPL_VAR NAME=val></td>
+ </TMPL_LOOP>
+</tr>
+<tr>
+ <th>Index DataMemory/Row</th>
+ <TMPL_LOOP NAME=IndexDataMemory>
+ <td><TMPL_VAR NAME=val></td>
+ </TMPL_LOOP>
+</tr>
+<tr>
+ <th>Total DataMemory/Row</th>
+ <TMPL_LOOP NAME=TotalDataMemory>
+ <td><TMPL_VAR NAME=val></td>
+ </TMPL_LOOP>
+</tr>
+<tr>
+ <th>Rows per 32kb page</th>
+ <TMPL_LOOP NAME=RowPerPage>
+ <td><TMPL_VAR NAME=val></td>
+ </TMPL_LOOP>
+</tr>
+<tr>
+ <th>Current number of rows</th>
+ <TMPL_LOOP NAME=count>
+ <td><TMPL_VAR NAME=val></td>
+ </TMPL_LOOP>
+</tr>
+<tr>
+ <th>Total DataMemory (kb)</th>
+ <TMPL_LOOP NAME=DataMemory>
+ <td><TMPL_VAR NAME=val></td>
+ </TMPL_LOOP>
+</tr>
+</table>
+
+<h3>IndexMemory Usage</h3>
+<table>
+<tr>
+ <th>&nbsp;</th>
+ <TMPL_LOOP NAME=releases>
+ <th><TMPL_VAR NAME=rel></th>
+ </TMPL_LOOP>
+</tr>
+<tr>
+ <th>IndexMemory/Row</th>
+ <TMPL_LOOP NAME=RowIndexMemory>
+ <td><TMPL_VAR NAME=val></td>
+ </TMPL_LOOP>
+</tr>
+<tr>
+ <th>Rows per 8kb page</th>
+ <TMPL_LOOP NAME=RowPerIndexPage>
+ <td><TMPL_VAR NAME=val></td>
+ </TMPL_LOOP>
+</tr>
+<tr>
+ <th>Current number of rows</th>
+ <TMPL_LOOP NAME=count>
+ <td><TMPL_VAR NAME=val></td>
+ </TMPL_LOOP>
+</tr>
+<tr>
+ <th>Total IndexMemory (kb)</th>
+ <TMPL_LOOP NAME=IndexMemory>
+ <td><TMPL_VAR NAME=val></td>
+ </TMPL_LOOP>
+</tr>
+</table>
+
+<hr/>
+</TMPL_LOOP>
+
+<p>This is the output of ndb_size.pl.</p>
+</body>
+</html>
+
diff --git a/ndb/tools/restore/consumer_restore.cpp b/ndb/tools/restore/consumer_restore.cpp
index 5786bdac697..552246a4f9e 100644
--- a/ndb/tools/restore/consumer_restore.cpp
+++ b/ndb/tools/restore/consumer_restore.cpp
@@ -38,7 +38,7 @@ BackupRestore::init()
m_cluster_connection = new Ndb_cluster_connection(g_connect_string);
if(m_cluster_connection->connect(12, 5, 1) != 0)
{
- return -1;
+ return false;
}
m_ndb = new Ndb(m_cluster_connection);