List:Commits« Previous MessageNext Message »
From:Sergey Glukhov Date:July 4 2008 11:37am
Subject:bzr commit into mysql-5.1 branch (gluh:2657) Bug#31399
View as plain text  
#At file:///home/gluh/MySQL/bazaar/mysql-5.1-bug-12345/

 2657 Sergey Glukhov	2008-07-04
      Bug#31399 Wrong query result when doing join buffering over BIT fields
      set correct position for bit field in the record
modified:
  mysql-test/r/type_bit.result
  mysql-test/t/type_bit.test
  sql/field.cc

per-file messages:
  mysql-test/r/type_bit.result
    test result
  mysql-test/t/type_bit.test
    test case
  sql/field.cc
    set correct position for bit field in the record
=== modified file 'mysql-test/r/type_bit.result'
--- a/mysql-test/r/type_bit.result	2007-12-07 14:15:58 +0000
+++ b/mysql-test/r/type_bit.result	2008-07-04 11:37:04 +0000
@@ -710,4 +710,22 @@ t1	CREATE TABLE `t1` (
   KEY `a` (`a`)
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop table t1;
+create table t1bit7 (a1 bit(7) not null) engine=MyISAM;
+create table t2bit7 (b1 bit(7) not null) engine=MyISAM;
+insert into t1bit7 values (b'1100000');
+insert into t1bit7 values (b'1100001');
+insert into t1bit7 values (b'1100010');
+insert into t2bit7 values (b'1100001');
+insert into t2bit7 values (b'1100010');
+insert into t2bit7 values (b'1100110');
+select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1;
+bin(a1)
+1100001
+1100010
+select bin(a1) from t1bit7
+where a1 in (select b1 from t2bit7);
+bin(a1)
+1100001
+1100010
+drop table t1bit7, t2bit7;
 End of 5.1 tests

=== modified file 'mysql-test/t/type_bit.test'
--- a/mysql-test/t/type_bit.test	2007-11-23 10:26:19 +0000
+++ b/mysql-test/t/type_bit.test	2008-07-04 11:37:04 +0000
@@ -350,4 +350,24 @@ select hex(a) from t1;
 show create table t1;
 drop table t1;
 
+#
+# Bug#31399 Wrong query result when doing join buffering over BIT fields
+#
+create table t1bit7 (a1 bit(7) not null) engine=MyISAM;
+create table t2bit7 (b1 bit(7) not null) engine=MyISAM;
+
+insert into t1bit7 values (b'1100000');
+insert into t1bit7 values (b'1100001');
+insert into t1bit7 values (b'1100010');
+insert into t2bit7 values (b'1100001');
+insert into t2bit7 values (b'1100010');
+insert into t2bit7 values (b'1100110');
+
+select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1;
+
+select bin(a1) from t1bit7
+where a1 in (select b1 from t2bit7);
+
+drop table t1bit7, t2bit7;
+
 --echo End of 5.1 tests

=== modified file 'sql/field.cc'
--- a/sql/field.cc	2008-05-13 12:01:02 +0000
+++ b/sql/field.cc	2008-07-04 11:37:04 +0000
@@ -1719,6 +1719,8 @@ uint Field::fill_cache_field(CACHE_FIELD
   }
   else
   {
+    if(type() == MYSQL_TYPE_BIT)
+      copy->str= ((Field_bit*) this)->bit_ptr;
     copy->strip=0;
     store_length= 0;
   }

Thread
bzr commit into mysql-5.1 branch (gluh:2657) Bug#31399Sergey Glukhov4 Jul