Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
8bb1af7a
Commit
8bb1af7a
authored
Sep 14, 2005
by
stewart@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WL#2779 ndb_size.pl
Bug reported by Adam Dixon - table name needs quoting.
parent
ff640a0f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
ndb/tools/ndb_size.pl
ndb/tools/ndb_size.pl
+7
-4
No files found.
ndb/tools/ndb_size.pl
View file @
8bb1af7a
...
@@ -68,8 +68,9 @@ foreach(@{$tables})
...
@@ -68,8 +68,9 @@ foreach(@{$tables})
{
{
my
$table
=
@
{
$_
}[
0
];
my
$table
=
@
{
$_
}[
0
];
my
@columns
;
my
@columns
;
my
$info
=
$dbh
->
selectall_hashref
("
describe
$table
","
Field
");
my
$info
=
$dbh
->
selectall_hashref
("
describe
"
.
$dbh
->
quote
(
$table
),"
Field
");
my
@count
=
$dbh
->
selectrow_array
("
select count(*) from
$table
");
my
@count
=
$dbh
->
selectrow_array
("
select count(*) from
"
.
$dbh
->
quote
(
$table
));
my
%
columnsize
;
# used for index calculations
my
%
columnsize
;
# used for index calculations
# We now work out the DataMemory usage
# We now work out the DataMemory usage
...
@@ -129,7 +130,9 @@ foreach(@{$tables})
...
@@ -129,7 +130,9 @@ foreach(@{$tables})
elsif
(
$type
=~
/varchar/
||
$type
=~
/varbinary/
)
elsif
(
$type
=~
/varchar/
||
$type
=~
/varbinary/
)
{
{
my
$fixed
=
1
+
$size
;
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
];
$dynamic
[
0
]
=
0
if
!
$dynamic
[
0
];
@realsize
=
(
$fixed
,
$fixed
,
ceil
(
$dynamic
[
0
]));
@realsize
=
(
$fixed
,
$fixed
,
ceil
(
$dynamic
[
0
]));
}
}
...
@@ -163,7 +166,7 @@ foreach(@{$tables})
...
@@ -163,7 +166,7 @@ foreach(@{$tables})
# we can still connect to pre-5.0 mysqlds.
# we can still connect to pre-5.0 mysqlds.
my
%
indexes
;
my
%
indexes
;
{
{
my
$sth
=
$dbh
->
prepare
("
show index from
$table
"
);
my
$sth
=
$dbh
->
prepare
("
show index from
"
$dbh
->
quote
(
$table
)
);
$sth
->
execute
;
$sth
->
execute
;
while
(
my
$i
=
$sth
->
fetchrow_hashref
)
while
(
my
$i
=
$sth
->
fetchrow_hashref
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment