From: Date: November 23 2005 4:19pm Subject: bk commit into 5.0 tree (SergeyV:1.1974) BUG#14902 List-Archive: http://lists.mysql.com/internals/32604 X-Bug: 14902 Message-Id: <200511231519.jANFJ09E001219@selena.creware.com> Below is the list of changes that have just been committed into a local 5.0 repository of sergeyv. When sergeyv does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.1974 05/11/23 18:18:41 SergeyV@selena. +3 -0 Fixes bug #14902. When analysing a table with FT index that contains stopwords table statistics is not updated, so the next execution of analyze table will try to update statistics again. mysql-test/t/analyze.test 1.6 05/11/23 18:18:30 SergeyV@selena. +14 -0 Test for bug #14902. mysql-test/r/analyze.result 1.3 05/11/23 18:18:30 SergeyV@selena. +9 -0 Updated result file for bug #14902 test. myisam/mi_check.c 1.141 05/11/23 18:18:29 SergeyV@selena. +2 -1 Fixes bug #14902. When analysing a table with FT index that contains stopwords table statistics is not updated, so the next execution of analyze table will try to update statistics again. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: SergeyV # Host: selena. # Root: H:/MYSQL/src/#14902-mysql-5.0 --- 1.140/myisam/mi_check.c 2005-11-01 19:40:49 +03:00 +++ 1.141/myisam/mi_check.c 2005-11-23 18:18:29 +03:00 @@ -402,7 +402,7 @@ full_text_keys++; if (share->state.key_root[key] == HA_OFFSET_ERROR && (info->state->records == 0 || keyinfo->flag & HA_FULLTEXT)) - continue; + goto do_stat; if (!_mi_fetch_keypage(info,keyinfo,share->state.key_root[key], DFLT_INIT_HITS,info->buff,0)) { @@ -498,6 +498,7 @@ param->max_level); all_keydata+=param->keydata; all_totaldata+=param->totaldata; key_totlength+=length; +do_stat: if (param->testflag & T_STATISTICS) update_key_parts(keyinfo, rec_per_key_part, param->unique_count, param->stats_method == MI_STATS_METHOD_IGNORE_NULLS? --- 1.2/mysql-test/r/analyze.result 2005-09-15 18:18:52 +04:00 +++ 1.3/mysql-test/r/analyze.result 2005-11-23 18:18:30 +03:00 @@ -30,3 +30,12 @@ Table Op Msg_type Msg_text test.t1 check status OK drop table t1; +create table t1 (a mediumtext, fulltext key key1(a)) charset utf8 collate utf8_general_ci engine myisam; +insert into t1 values ('hello'); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status Table is already up to date +drop table t1; --- 1.5/mysql-test/t/analyze.test 2005-09-15 18:17:08 +04:00 +++ 1.6/mysql-test/t/analyze.test 2005-11-23 18:18:30 +03:00 @@ -39,4 +39,18 @@ drop table t1; +# Bug #14902 ANALYZE TABLE fails to recognize up-to-date tables +# minimal test case to get an error. +# The problem is happening when analysing table with FT index that +# contains stopwords only. The first execution of analyze table should +# mark index statistics as up to date so that next execution of this +# statement will end up with Table is up to date status. +create table t1 (a mediumtext, fulltext key key1(a)) charset utf8 collate utf8_general_ci engine myisam; +insert into t1 values ('hello'); + +analyze table t1; +analyze table t1; + +drop table t1; + # End of 4.1 tests