List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:August 10 2006 1:44pm
Subject:bk commit into 4.1 tree (svoj:1.2533) BUG#18874
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of svoj. When svoj 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@stripped, 2006-08-10 18:44:41+05:00, svoj@stripped +3 -0
  BUG#18874 - Setting myisam_repair_threads > 1, index cardinality always 1
  
  When myisam_repair_threads value to > 1, index repair operation always
  sets index cardinality to 1.
  
  Fixed wrong index cardinality calculation for index repair operation
  when myisam_repair_threads is > 1.

  myisam/sort.c@stripped, 2006-08-10 18:44:37+05:00, svoj@stripped +5 -7
    write_index() collects index statistic which is further used in
    update_key_parts(). Thus update_key_parts() must be called after
    write_index().

  mysql-test/r/repair.result@stripped, 2006-08-10 18:44:37+05:00, svoj@stripped +11 -0
    Test case for bug#18874.

  mysql-test/t/repair.test@stripped, 2006-08-10 18:44:37+05:00, svoj@stripped +11 -0
    Test case for bug#18874.

# 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:	svoj
# Host:	may.pils.ru
# Root:	/home/svoj/devel/mysql/BUG18874/mysql-4.1

--- 1.45/myisam/sort.c	2006-08-10 18:44:47 +05:00
+++ 1.46/myisam/sort.c	2006-08-10 18:44:47 +05:00
@@ -480,13 +480,6 @@
     if (!got_error)
     {
       share->state.key_map|=(ulonglong) 1 << sinfo->key;
-      if (param->testflag & T_STATISTICS)
-        update_key_parts(sinfo->keyinfo, rec_per_key_part, sinfo->unique,
-                         param->stats_method == MI_STATS_METHOD_IGNORE_NULLS?
-                         sinfo->notnull: NULL,
-                         (ulonglong) info->state->records);
-
-
       if (!sinfo->buffpek.elements)
       {
         if (param->testflag & T_VERBOSE)
@@ -498,6 +491,11 @@
             flush_ft_buf(sinfo) || flush_pending_blocks(sinfo))
           got_error=1;
       }
+      if (!got_error && param->testflag & T_STATISTICS)
+        update_key_parts(sinfo->keyinfo, rec_per_key_part, sinfo->unique,
+                         param->stats_method == MI_STATS_METHOD_IGNORE_NULLS?
+                         sinfo->notnull: NULL,
+                         (ulonglong) info->state->records);
     }
     my_free((gptr) sinfo->sort_keys,MYF(0));
     my_free(mi_get_rec_buff_ptr(info, sinfo->rec_buff),

--- 1.16/mysql-test/r/repair.result	2006-08-10 18:44:47 +05:00
+++ 1.17/mysql-test/r/repair.result	2006-08-10 18:44:47 +05:00
@@ -37,3 +37,14 @@
 test.t1	repair	warning	Number of rows changed from 0 to 1
 test.t1	repair	status	OK
 drop table t1;
+CREATE TABLE t1(a INT, KEY(a));
+INSERT INTO t1 VALUES(1),(2),(3),(4),(5);
+SET myisam_repair_threads=2;
+REPAIR TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	repair	status	OK
+SHOW INDEX FROM t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment
+t1	1	a	1	a	A	5	NULL	NULL	YES	BTREE	
+SET myisam_repair_threads=@@global.myisam_repair_threads;
+DROP TABLE t1;

--- 1.14/mysql-test/t/repair.test	2006-08-10 18:44:47 +05:00
+++ 1.15/mysql-test/t/repair.test	2006-08-10 18:44:47 +05:00
@@ -34,4 +34,15 @@
 repair table t1 use_frm;
 drop table t1;
 
+#
+# BUG#18874 - Setting myisam_repair_threads > 1, index cardinality always 1
+#
+CREATE TABLE t1(a INT, KEY(a));
+INSERT INTO t1 VALUES(1),(2),(3),(4),(5);
+SET myisam_repair_threads=2;
+REPAIR TABLE t1;
+SHOW INDEX FROM t1;
+SET myisam_repair_threads=@@global.myisam_repair_threads;
+DROP TABLE t1;
+
 # End of 4.1 tests
Thread
bk commit into 4.1 tree (svoj:1.2533) BUG#18874Sergey Vojtovich10 Aug