Commit ef481319 authored by unknown's avatar unknown

Merge c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/bug19501

into  c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/bug19010


mysql-test/r/partition.result:
  manual merge
mysql-test/t/partition.test:
  manual merge
parents 1e135a10 e79ced8b
......@@ -895,4 +895,18 @@ t1 CREATE TABLE `t1` (
`a` varchar(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY (a)
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
......@@ -1019,4 +1019,19 @@ as select 'a';
show create table 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
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment