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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
d9ca07a7
Commit
d9ca07a7
authored
May 04, 2006
by
mikael@c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#19501: Data_Free incorrectly handled for partitioned tables
parent
4ba1a4b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
mysql-test/r/partition.result
mysql-test/r/partition.result
+14
-0
mysql-test/t/partition.test
mysql-test/t/partition.test
+15
-0
sql/ha_partition.cc
sql/ha_partition.cc
+4
-0
No files found.
mysql-test/r/partition.result
View file @
d9ca07a7
...
...
@@ -886,4 +886,18 @@ s1
2
3
drop table t1;
CREATE TABLE t1 (a int) ENGINE = MYISAM PARTITION BY KEY(a);
INSERT into t1 values (1), (2);
SHOW TABLE STATUS;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MyISAM 10 Fixed 2 7 14 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
DELETE from t1 where a = 1;
SHOW TABLE STATUS;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MyISAM 10 Fixed 1 14 14 0 0 7 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
ALTER TABLE t1 OPTIMIZE PARTITION p0;
SHOW TABLE STATUS;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MyISAM 10 Fixed 1 7 7 0 1024 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
DROP TABLE t1;
End of 5.1 tests
mysql-test/t/partition.test
View file @
d9ca07a7
...
...
@@ -1009,4 +1009,19 @@ select auto_increment from information_schema.tables where table_name='t1';
select
*
from
t1
;
drop
table
t1
;
#
# BUG 19501 Partitions: SHOW TABLE STATUS shows wrong Data_free
#
CREATE
TABLE
t1
(
a
int
)
ENGINE
=
MYISAM
PARTITION
BY
KEY
(
a
);
INSERT
into
t1
values
(
1
),
(
2
);
--
replace_column
9
0
12
NULL
13
NULL
14
NULL
SHOW
TABLE
STATUS
;
DELETE
from
t1
where
a
=
1
;
--
replace_column
9
0
12
NULL
13
NULL
14
NULL
SHOW
TABLE
STATUS
;
ALTER
TABLE
t1
OPTIMIZE
PARTITION
p0
;
--
replace_column
12
NULL
13
NULL
14
NULL
SHOW
TABLE
STATUS
;
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
sql/ha_partition.cc
View file @
d9ca07a7
...
...
@@ -4169,6 +4169,8 @@ void ha_partition::info(uint flag)
index_file_length: Length of index file, in principle bytes in
indexes in the table
We report sum
delete_length: Length of free space easily used by new records in table
We report sum
mean_record_length:Mean record length in the table
We calculate this
check_time: Time of last check (only applicable to MyISAM)
...
...
@@ -4178,6 +4180,7 @@ void ha_partition::info(uint flag)
deleted
=
0
;
data_file_length
=
0
;
index_file_length
=
0
;
delete_length
=
0
;
check_time
=
0
;
file_array
=
m_file
;
do
...
...
@@ -4190,6 +4193,7 @@ void ha_partition::info(uint flag)
deleted
+=
file
->
deleted
;
data_file_length
+=
file
->
data_file_length
;
index_file_length
+=
file
->
index_file_length
;
delete_length
+=
file
->
delete_length
;
if
(
file
->
check_time
>
check_time
)
check_time
=
file
->
check_time
;
}
...
...
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