MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:<gshchepa Date:November 21 2007 6:56pm
Subject:bk commit into 5.0 tree (gshchepa:1.2578) BUG#32556
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of uchum. When uchum 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, 2007-11-21 22:56:42+04:00, gshchepa@stripped +3 -0
  Fixed bug #32556: assert in "using index for group-by" :
                    is_last_prefix <= 0, file .\opt_range.cc.
  
  SELECT ... GROUP BY bit field failed with an assertion if the
  bit length of that field was not divisible by 8.
  

  mysql-test/r/type_bit.result@stripped, 2007-11-21 22:39:16+04:00, gshchepa@stripped +10 -0
    Added test case for bug #32556.

  mysql-test/t/type_bit.test@stripped, 2007-11-21 22:39:04+04:00, gshchepa@stripped +15 -0
    Added test case for bug #32556.

  sql/key.cc@stripped, 2007-11-21 22:38:52+04:00, gshchepa@stripped +0 -13
    Fixed bug #32556.
    Copying of "uneven" bits of a bit field was duplicated in the
    key_copy() and in the Field_bit::get_key_image().
    So, instead of copying of the rest of a bit field, 
    Field_bit::get_key_image() copied "uneven" bits to key image again,
    and the lowest field byte was not copied to key at all.
    
    Duplicated code has been removed from the key_copy function.

diff -Nrup a/mysql-test/r/type_bit.result b/mysql-test/r/type_bit.result
--- a/mysql-test/r/type_bit.result	2007-09-14 15:53:11 +05:00
+++ b/mysql-test/r/type_bit.result	2007-11-21 22:39:16 +04:00
@@ -672,4 +672,14 @@ COUNT(DISTINCT b,c)
 2
 2
 DROP TABLE t2;
+CREATE TABLE t1(a BIT(13), KEY(a));
+INSERT INTO t1(a) VALUES
+(65535),(65525),(65535),(65535),(65535),(65535),(65535),(65535),(65535),(65535);
+EXPLAIN SELECT 1 FROM t1 GROUP BY a;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	range	NULL	a	3	NULL	6	Using index for group-by
+SELECT 1 FROM t1 GROUP BY a;
+1
+1
+DROP TABLE t1;
 End of 5.0 tests
diff -Nrup a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test
--- a/mysql-test/t/type_bit.test	2007-09-14 15:53:11 +05:00
+++ b/mysql-test/t/type_bit.test	2007-11-21 22:39:04 +04:00
@@ -318,4 +318,19 @@ INSERT INTO t2 VALUES (3, 2, 'two'), (2,
 SELECT COUNT(DISTINCT b,c) FROM t2 GROUP BY a;
 DROP TABLE t2;
 
+#
+# BUG#32556 assert in "using index for group-by" : is_last_prefix <= 0,
+#           file .\opt_range.cc
+
+CREATE TABLE t1(a BIT(13), KEY(a));
+--disable_warnings
+INSERT INTO t1(a) VALUES
+(65535),(65525),(65535),(65535),(65535),(65535),(65535),(65535),(65535),(65535);
+--enable_warnings
+
+EXPLAIN SELECT 1 FROM t1 GROUP BY a;
+SELECT 1 FROM t1 GROUP BY a;
+
+DROP TABLE t1;
+
 --echo End of 5.0 tests
diff -Nrup a/sql/key.cc b/sql/key.cc
--- a/sql/key.cc	2007-04-29 12:56:19 +05:00
+++ b/sql/key.cc	2007-11-21 22:38:52 +04:00
@@ -106,19 +106,6 @@ void key_copy(byte *to_key, byte *from_r
 		   key_part->null_bit);
       key_length--;
     }
-    if (key_part->type == HA_KEYTYPE_BIT)
-    {
-      Field_bit *field= (Field_bit *) (key_part->field);
-      if (field->bit_len)
-      {
-        uchar bits= get_rec_bits((uchar*) from_record +
-                                 key_part->null_offset +
-                                 (key_part->null_bit == 128),
-                                 field->bit_ofs, field->bit_len);
-        *to_key++= bits;
-        key_length--;
-      }
-    }
     if (key_part->key_part_flag & HA_BLOB_PART ||
         key_part->key_part_flag & HA_VAR_LENGTH_PART)
     {
Thread
bk commit into 5.0 tree (gshchepa:1.2578) BUG#32556gshchepa21 Nov