List:Internals« Previous MessageNext Message »
From:ramil Date:April 14 2005 9:32am
Subject:bk commit into 5.0 tree (ramil:1.1827)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of ram. When ram 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.1827 05/04/14 14:32:25 ramil@stripped +4 -0
  Bit type: fix for create_field::create_field().

  sql/field.h
    1.153 05/04/14 14:32:18 ramil@stripped +1 -2
    Bit type: fix for create_field::create_field().

  sql/field.cc
    1.256 05/04/14 14:32:18 ramil@stripped +3 -1
    Bit type: fix for create_field::create_field().
    We should return saved length in case of Field_bit_as_char.

  mysql-test/t/type_bit_innodb.test
    1.2 05/04/14 14:32:18 ramil@stripped +12 -0
    Bit type: fix for create_field::create_field().

  mysql-test/r/type_bit_innodb.result
    1.2 05/04/14 14:32:17 ramil@stripped +22 -0
    Bit type: fix for create_field::create_field().

# 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:	ramil
# Host:	gw.mysql.r18.ru
# Root:	/usr/home/ram/work/5.0.bit_class

--- 1.255/sql/field.cc	2005-04-12 19:36:04 +05:00
+++ 1.256/sql/field.cc	2005-04-14 14:32:18 +05:00
@@ -8358,7 +8358,9 @@
     break;
 #endif
   case FIELD_TYPE_BIT:
-    length= ((Field_bit *) old_field)->bit_len + length * 8;
+    length= (old_field->key_type() == HA_KEYTYPE_BIT) ?
+            ((Field_bit *) old_field)->bit_len + length * 8 :
+            ((Field_bit_as_char *) old_field)->create_length;
     break;
   default:
     break;

--- 1.152/sql/field.h	2005-04-12 23:11:55 +05:00
+++ 1.153/sql/field.h	2005-04-14 14:32:18 +05:00
@@ -1313,9 +1313,8 @@
 
   
 class Field_bit_as_char: public Field_bit {
-protected:
-  uchar create_length;
 public:
+  uchar create_length;
   Field_bit_as_char(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
                     uchar null_bit_arg, uchar *bit_ptr_arg, uchar bit_ofs_arg,
                     enum utype unireg_check_arg, const char *field_name_arg,

--- 1.1/mysql-test/r/type_bit_innodb.result	2005-04-12 12:27:37 +05:00
+++ 1.2/mysql-test/r/type_bit_innodb.result	2005-04-14 14:32:17 +05:00
@@ -380,3 +380,25 @@
 create table t1(a int, b bit not null) engine=innodb;
 alter table t1 add primary key (a);
 drop table t1;
+create table t1 (a bit, b bit(10)) engine=innodb;
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` bit(1) default NULL,
+  `b` bit(10) default NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+alter table t1 engine=heap;
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` bit(1) default NULL,
+  `b` bit(10) default NULL
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+alter table t1 engine=innodb;
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` bit(1) default NULL,
+  `b` bit(10) default NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t1;

--- 1.1/mysql-test/t/type_bit_innodb.test	2005-04-12 12:27:37 +05:00
+++ 1.2/mysql-test/t/type_bit_innodb.test	2005-04-14 14:32:18 +05:00
@@ -121,3 +121,15 @@
 create table t1(a int, b bit not null) engine=innodb;
 alter table t1 add primary key (a);
 drop table t1;
+
+#
+# altering tables
+#
+
+create table t1 (a bit, b bit(10)) engine=innodb;
+show create table t1;
+alter table t1 engine=heap;
+show create table t1;
+alter table t1 engine=innodb;
+show create table t1;
+drop table t1;
Thread
bk commit into 5.0 tree (ramil:1.1827)ramil14 Apr