List:Commits« Previous MessageNext Message »
From:marko.makela Date:August 8 2011 9:48am
Subject:bzr push into mysql-5.1 branch (marko.makela:3579 to 3580) Bug#12770537
View as plain text  
 3580 Marko Mäkelä	2011-08-08
      Bug#12770537 I_S.TABLES.DATA_LENGTH does not show on-disk size
      for compressed InnoDB tables
      
      ha_innodb::info_low(): For calculating data_length or index_length,
      use the compressed page size for compressed tables instead of UNIV_PAGE_SIZE.
      
      rb:714 approved by Sunny Bains

    modified:
      mysql-test/suite/innodb_plugin/r/innodb-zip.result
      mysql-test/suite/innodb_plugin/t/innodb-zip.test
      storage/innodb_plugin/ChangeLog
      storage/innodb_plugin/handler/ha_innodb.cc
 3579 Sergey Glukhov	2011-08-02
      Bug#11766594 59736: SELECT DISTINCT.. INCORRECT RESULT WITH DETERMINISTIC FUNCTION IN WHERE C
      There is an optimization of DISTINCT in JOIN::optimize()
      which depends on THD::used_tables value. Each SELECT statement
      inside SP resets used_tables value(see mysql_select()) and it
      leads to wrong result. The fix is to replace THD::used_tables
      with LEX::used_tables.
     @ mysql-test/r/sp.result
        test case
     @ mysql-test/t/sp.test
        test case
     @ sql/sql_base.cc
        THD::used_tables is replaced with LEX::used_tables
     @ sql/sql_class.cc
        THD::used_tables is replaced with LEX::used_tables
     @ sql/sql_class.h
        THD::used_tables is replaced with LEX::used_tables
     @ sql/sql_insert.cc
        THD::used_tables is replaced with LEX::used_tables
     @ sql/sql_lex.cc
        THD::used_tables is replaced with LEX::used_tables
     @ sql/sql_lex.h
        THD::used_tables is replaced with LEX::used_tables
     @ sql/sql_prepare.cc
        THD::used_tables is replaced with LEX::used_tables
     @ sql/sql_select.cc
        THD::used_tables is replaced with LEX::used_tables

    modified:
      mysql-test/r/sp.result
      mysql-test/t/sp.test
      sql/sql_base.cc
      sql/sql_class.cc
      sql/sql_class.h
      sql/sql_insert.cc
      sql/sql_lex.cc
      sql/sql_lex.h
      sql/sql_prepare.cc
      sql/sql_select.cc
=== modified file 'mysql-test/suite/innodb_plugin/r/innodb-zip.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb-zip.result	revid:sergey.glukhov@stripped345-eet5onrn2rvatw5g
+++ b/mysql-test/suite/innodb_plugin/r/innodb-zip.result	revid:marko.makela@stripped08082218-s6v6faseuofd3l5o
@@ -62,42 +62,42 @@ row_format=compressed;
 create table t14(a int primary key) engine=innodb key_block_size=9;
 Warnings:
 Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=9.
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
 FROM information_schema.tables WHERE engine='innodb';
-table_schema	table_name	row_format
-test	t0	Compact
-test	t00	Compact
-test	t1	Compact
-test	t10	Dynamic
-test	t11	Compressed
-test	t12	Compressed
-test	t13	Compressed
-test	t14	Compact
-test	t2	Redundant
-test	t3	Compact
-test	t4	Compact
-test	t5	Redundant
-test	t6	Redundant
-test	t7	Redundant
-test	t8	Compact
-test	t9	Compact
+table_schema	table_name	row_format	data_length	index_length
+test	t0	Compact	16384	0
+test	t00	Compact	16384	0
+test	t1	Compact	16384	0
+test	t10	Dynamic	16384	0
+test	t11	Compressed	1024	0
+test	t12	Compressed	1024	0
+test	t13	Compressed	8192	0
+test	t14	Compact	16384	0
+test	t2	Redundant	16384	0
+test	t3	Compact	16384	0
+test	t4	Compact	16384	0
+test	t5	Redundant	16384	0
+test	t6	Redundant	16384	0
+test	t7	Redundant	16384	0
+test	t8	Compact	16384	0
+test	t9	Compact	16384	0
 drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
 alter table t1 key_block_size=0;
 alter table t1 row_format=dynamic;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
 FROM information_schema.tables WHERE engine='innodb';
-table_schema	table_name	row_format
-test	t1	Dynamic
+table_schema	table_name	row_format	data_length	index_length
+test	t1	Dynamic	16384	0
 alter table t1 row_format=compact;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
 FROM information_schema.tables WHERE engine='innodb';
-table_schema	table_name	row_format
-test	t1	Compact
+table_schema	table_name	row_format	data_length	index_length
+test	t1	Compact	16384	0
 alter table t1 row_format=redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
 FROM information_schema.tables WHERE engine='innodb';
-table_schema	table_name	row_format
-test	t1	Redundant
+table_schema	table_name	row_format	data_length	index_length
+test	t1	Redundant	16384	0
 drop table t1;
 create table t1(a int not null, b text, index(b(10))) engine=innodb
 key_block_size=1;
@@ -114,11 +114,11 @@ rollback;
 select a,left(b,40) from t1 natural join t2;
 a	left(b,40)
 1	1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
 FROM information_schema.tables WHERE engine='innodb';
-table_schema	table_name	row_format
-test	t1	Compressed
-test	t2	Compact
+table_schema	table_name	row_format	data_length	index_length
+test	t1	Compressed	2048	1024
+test	t2	Compact	16384	0
 drop table t1,t2;
 SET SESSION innodb_strict_mode = off;
 CREATE TABLE t1(
@@ -206,19 +206,19 @@ create table t8 (id int primary key) eng
 create table t9 (id int primary key) engine = innodb row_format = dynamic;
 create table t10(id int primary key) engine = innodb row_format = compact;
 create table t11(id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
 FROM information_schema.tables WHERE engine='innodb';
-table_schema	table_name	row_format
-test	t1	Compact
-test	t10	Compact
-test	t11	Redundant
-test	t3	Compressed
-test	t4	Compressed
-test	t5	Compressed
-test	t6	Compressed
-test	t7	Compressed
-test	t8	Compressed
-test	t9	Dynamic
+table_schema	table_name	row_format	data_length	index_length
+test	t1	Compact	16384	0
+test	t10	Compact	16384	0
+test	t11	Redundant	16384	0
+test	t3	Compressed	1024	0
+test	t4	Compressed	2048	0
+test	t5	Compressed	4096	0
+test	t6	Compressed	8192	0
+test	t7	Compressed	16384	0
+test	t8	Compressed	8192	0
+test	t9	Dynamic	16384	0
 drop table t1, t3, t4, t5, t6, t7, t8, t9, t10, t11;
 create table t1 (id int primary key) engine = innodb
 key_block_size = 8 row_format = compressed;
@@ -245,11 +245,11 @@ Warning	1478	InnoDB: cannot specify ROW_
 Error	1005	Can't create table 'test.t4' (errno: 1478)
 create table t5 (id int primary key) engine = innodb
 key_block_size = 8 row_format = default;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
 FROM information_schema.tables WHERE engine='innodb';
-table_schema	table_name	row_format
-test	t1	Compressed
-test	t5	Compressed
+table_schema	table_name	row_format	data_length	index_length
+test	t1	Compressed	8192	0
+test	t5	Compressed	8192	0
 drop table t1, t5;
 create table t1 (id int primary key) engine = innodb
 key_block_size = 9 row_format = redundant;
@@ -275,9 +275,9 @@ Level	Code	Message
 Warning	1478	InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
 Warning	1478	InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
 Error	1005	Can't create table 'test.t2' (errno: 1478)
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
 FROM information_schema.tables WHERE engine='innodb';
-table_schema	table_name	row_format
+table_schema	table_name	row_format	data_length	index_length
 set global innodb_file_per_table = off;
 create table t1 (id int primary key) engine = innodb key_block_size = 1;
 ERROR HY000: Can't create table 'test.t1' (errno: 1478)
@@ -323,11 +323,11 @@ Warning	1478	InnoDB: ROW_FORMAT=DYNAMIC
 Error	1005	Can't create table 'test.t7' (errno: 1478)
 create table t8 (id int primary key) engine = innodb row_format = compact;
 create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
 FROM information_schema.tables WHERE engine='innodb';
-table_schema	table_name	row_format
-test	t8	Compact
-test	t9	Redundant
+table_schema	table_name	row_format	data_length	index_length
+test	t8	Compact	16384	0
+test	t9	Redundant	16384	0
 drop table t8, t9;
 set global innodb_file_per_table = on;
 set global innodb_file_format = `0`;
@@ -375,11 +375,11 @@ Warning	1478	InnoDB: ROW_FORMAT=DYNAMIC
 Error	1005	Can't create table 'test.t7' (errno: 1478)
 create table t8 (id int primary key) engine = innodb row_format = compact;
 create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
 FROM information_schema.tables WHERE engine='innodb';
-table_schema	table_name	row_format
-test	t8	Compact
-test	t9	Redundant
+table_schema	table_name	row_format	data_length	index_length
+test	t8	Compact	16384	0
+test	t9	Redundant	16384	0
 drop table t8, t9;
 set global innodb_file_per_table=0;
 set global innodb_file_format=Antelope;

=== modified file 'mysql-test/suite/innodb_plugin/t/innodb-zip.test'
--- a/mysql-test/suite/innodb_plugin/t/innodb-zip.test	revid:sergey.glukhov@stripped110802073345-eet5onrn2rvatw5g
+++ b/mysql-test/suite/innodb_plugin/t/innodb-zip.test	revid:marko.makela@stripped-20110808082218-s6v6faseuofd3l5o
@@ -36,19 +36,19 @@ create table t13(a int primary key) engi
 row_format=compressed;
 create table t14(a int primary key) engine=innodb key_block_size=9;
 
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
 FROM information_schema.tables WHERE engine='innodb';
 
 drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
 alter table t1 key_block_size=0;
 alter table t1 row_format=dynamic;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
 FROM information_schema.tables WHERE engine='innodb';
 alter table t1 row_format=compact;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
 FROM information_schema.tables WHERE engine='innodb';
 alter table t1 row_format=redundant;
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
 FROM information_schema.tables WHERE engine='innodb';
 drop table t1;
 
@@ -81,7 +81,7 @@ connection default;
 disconnect a;
 disconnect b;
 
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
 FROM information_schema.tables WHERE engine='innodb';
 drop table t1,t2;
 
@@ -192,7 +192,7 @@ create table t9 (id int primary key) eng
 create table t10(id int primary key) engine = innodb row_format = compact;
 create table t11(id int primary key) engine = innodb row_format = redundant;
 
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
 FROM information_schema.tables WHERE engine='innodb';
 drop table t1, t3, t4, t5, t6, t7, t8, t9, t10, t11;
 
@@ -218,7 +218,7 @@ show warnings;
 create table t5 (id int primary key) engine = innodb
 key_block_size = 8 row_format = default;
 
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
 FROM information_schema.tables WHERE engine='innodb';
 drop table t1, t5;
 
@@ -238,7 +238,7 @@ create table t2 (id int primary key) eng
 key_block_size = 9 row_format = dynamic;
 show warnings;
 
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
 FROM information_schema.tables WHERE engine='innodb';
 
 #test valid values with innodb_file_per_table unset
@@ -268,7 +268,7 @@ show warnings;
 create table t8 (id int primary key) engine = innodb row_format = compact;
 create table t9 (id int primary key) engine = innodb row_format = redundant;
 
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
 FROM information_schema.tables WHERE engine='innodb';
 drop table t8, t9;
 
@@ -300,7 +300,7 @@ show warnings;
 create table t8 (id int primary key) engine = innodb row_format = compact;
 create table t9 (id int primary key) engine = innodb row_format = redundant;
 
-SELECT table_schema, table_name, row_format
+SELECT table_schema, table_name, row_format, data_length, index_length
 FROM information_schema.tables WHERE engine='innodb';
 drop table t8, t9;
 

=== modified file 'storage/innodb_plugin/ChangeLog'
--- a/storage/innodb_plugin/ChangeLog	revid:sergey.glukhov@stripped
+++ b/storage/innodb_plugin/ChangeLog	revid:marko.makela@oracle.com-20110808082218-s6v6faseuofd3l5o
@@ -1,9 +1,15 @@
+2011-08-08	The InnoDB Team
+
+	* handler/ha_innodb.cc:
+	Fix Bug#12770537 I_S.TABLES.DATA_LENGTH DOES NOT SHOW ON-DISK SIZE
+	FOR COMPRESSED INNODB
+
 2011-07-19	The InnoDB Team
 
 	* buf/buf0buf.c, buf/buf0rea.c, handler/ha_innodb.cc,
 	include/buf0buf.h, include/buf0buf.ic, include/srv0srv.h,
 	srv/srv0srv.c:
-	Fix bug#Bug 12356373 by reintroducing random readahead
+	Fix Bug#12356373 by reintroducing random readahead
 
 2011-06-30	The InnoDB Team
 

=== modified file 'storage/innodb_plugin/handler/ha_innodb.cc'
--- a/storage/innodb_plugin/handler/ha_innodb.cc	revid:sergey.glukhov@strippedg
+++ b/storage/innodb_plugin/handler/ha_innodb.cc	revid:marko.makela@stripped
@@ -7652,6 +7652,8 @@ ha_innobase::info_low(
 
 	if (flag & HA_STATUS_VARIABLE) {
 
+		ulint	page_size;
+
 		dict_table_stats_lock(ib_table, RW_S_LATCH);
 
 		n_rows = ib_table->stat_n_rows;
@@ -7694,14 +7696,19 @@ ha_innobase::info_low(
 			prebuilt->autoinc_last_value = 0;
 		}
 
+		page_size = dict_table_zip_size(ib_table);
+		if (page_size == 0) {
+			page_size = UNIV_PAGE_SIZE;
+		}
+
 		stats.records = (ha_rows)n_rows;
 		stats.deleted = 0;
-		stats.data_file_length = ((ulonglong)
-				ib_table->stat_clustered_index_size)
-					* UNIV_PAGE_SIZE;
-		stats.index_file_length = ((ulonglong)
-				ib_table->stat_sum_of_other_index_sizes)
-					* UNIV_PAGE_SIZE;
+		stats.data_file_length
+			= ((ulonglong) ib_table->stat_clustered_index_size)
+			* page_size;
+		stats.index_file_length =
+			((ulonglong) ib_table->stat_sum_of_other_index_sizes)
+			* page_size;
 
 		dict_table_stats_unlock(ib_table, RW_S_LATCH);
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1 branch (marko.makela:3579 to 3580) Bug#12770537marko.makela10 Aug