From: vasil.dimov Date: June 12 2012 10:42am Subject: bzr push into mysql-trunk branch (vasil.dimov:3993 to 3995) WL#6189 List-Archive: http://lists.mysql.com/commits/144214 Message-Id: <20120612104207.297C62E0B0@mail.v5d.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3995 Vasil Dimov 2012-06-12 Followup to WL#6189 Turn InnoDB persistent statistics ON by default Adjust mtr tests, part 30. Persistent stats use a different sampling algorithm so it is possible that the stats numbers differ from transient stats. Also, persistent stats are updated less frequently or with a delay, so it is possible that persistent stats are not up to date as transient were even if both algorithms would return the same results. The order of the returned rows by a SELECT query depends on the stats and thus, if possible, we fix tests by prepending "-- sorted_result" to SELECTs that happen to return rows in different order. If possible, each failing test was fixed by manually running ANALYZE TABLE. This is doable if both transient and persistent sampling algorithms end up with the same numbers for the given table and its data. If persistent stats result in different stats, then test failures were fixed by forcing the usage of transient stats for the table by using CREATE TABLE ... STATS_PERSISTENT=0. Intentionally do not fix the tests by using persistent stats and adjustin the output of EXPLAIN in .result files because a different execution plan may cause a different code path to be executed, than the one originally intended in the test. modified: mysql-test/suite/funcs_1/views/views_master.inc 3994 Vasil Dimov 2012-06-12 Add assertions in dict_stats_deinit() that it is called under dict_sys->mutex and that table->n_ref_count is 0. Deinitializing stats of a table that is being used (table->n_ref_count > 0) may lead to reading uninitialized memory. Also assert in dict_stats_snapshot_create() that the table stats are initialized. Copying uninitialized stats does not make sense. modified: storage/innobase/dict/dict0stats.cc storage/innobase/include/dict0stats.ic 3993 Hemant Kumar 2012-06-12 Fixing rpl_packet test failure after discussing it with Joro. modified: mysql-test/suite/rpl/t/rpl_packet.test === modified file 'mysql-test/suite/funcs_1/views/views_master.inc' --- a/mysql-test/suite/funcs_1/views/views_master.inc revid:hemant.hk.kumar@stripped +++ b/mysql-test/suite/funcs_1/views/views_master.inc revid:vasil.dimov@stripped @@ -2488,6 +2488,13 @@ Insert into t2 values (2, 'double', 6 Insert into t2 values (3, 'single-f3', 6, '3') ; Insert into t2 values (4, 'single', 4, '4') ; +-- disable_query_log +-- disable_result_log +analyze table t1; +analyze table t2; +-- enable_result_log +-- enable_query_log + # Testcase 3.3.1.55 ; create or replace view test.v1 as Select t1.f59 t1_f59, t2.f59 t2_f59, t1.f60 t1_f60, t2.f60 t2_f60, === modified file 'storage/innobase/dict/dict0stats.cc' --- a/storage/innobase/dict/dict0stats.cc revid:hemant.hk.kumar@stripped +++ b/storage/innobase/dict/dict0stats.cc revid:vasil.dimov@stripped @@ -339,6 +339,8 @@ dict_stats_snapshot_create( dict_table_stats_lock(table, RW_X_LATCH); + ut_a(table->stat_initialized); + /* Estimate the size needed for the table and all of its indexes */ heap_size = 0; === modified file 'storage/innobase/include/dict0stats.ic' --- a/storage/innobase/include/dict0stats.ic revid:hemant.hk.kumar@stripped +++ b/storage/innobase/include/dict0stats.ic revid:vasil.dimov@stripped @@ -194,6 +194,10 @@ dict_stats_deinit( /*==============*/ dict_table_t* table) /*!< in/out: table */ { + ut_ad(mutex_own(&dict_sys->mutex)); + + ut_a(table->n_ref_count == 0); + dict_table_stats_lock(table, RW_X_LATCH); if (!table->stat_initialized) { No bundle (reason: useless for push emails).