List:Internals« Previous MessageNext Message »
From:ramil Date:April 5 2005 10:40am
Subject:bk commit into 5.0 tree (ramil:1.1869) BUG#9571
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.1869 05/04/05 13:40:34 ramil@stripped +3 -0
  Fix for bug #9571: Primary key creation causes server crash.

  sql/unireg.cc
    1.53 05/04/05 13:40:28 ramil@stripped +2 -3
    Fix for bug #9571: Primary key creation causes server crash.
    We should pass null_pos to the make_field() anyway,
    as we use it for bit fields.
    

  mysql-test/t/type_bit.test
    1.6 05/04/05 13:40:28 ramil@stripped +8 -0
    Fix for bug #9571: Primary key creation causes server crash.

  mysql-test/r/type_bit.result
    1.7 05/04/05 13:40:27 ramil@stripped +3 -0
    Fix for bug #9571: Primary key creation causes server crash.

# 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/mysql-5.0

--- 1.52/sql/unireg.cc	2005-04-01 17:04:45 +05:00
+++ 1.53/sql/unireg.cc	2005-04-05 13:40:28 +05:00
@@ -679,15 +679,14 @@
     null_count++;
   }
   bfill(buff,(null_length=(null_fields+7)/8),255);
-  null_pos=buff;
+  null_pos= buff + null_count / 8;
 
   List_iterator<create_field> it(create_fields);
   thd->count_cuted_fields= CHECK_FIELD_WARN;    // To find wrong default values
   while ((field=it++))
   {
     Field *regfield=make_field((char*) buff+field->offset,field->length,
-			       field->flags & NOT_NULL_FLAG ? 0:
-			       null_pos+null_count/8,
+                               null_pos,
 			       null_count & 7,
 			       field->pack_flag,
 			       field->sql_type,

--- 1.6/mysql-test/r/type_bit.result	2005-03-29 17:40:51 +05:00
+++ 1.7/mysql-test/r/type_bit.result	2005-04-05 13:40:27 +05:00
@@ -377,3 +377,6 @@
 07	0FFE
 01	01FF
 drop table t1;
+create table t1(a int, b bit not null);
+alter table t1 add primary key (a);
+drop table t1;

--- 1.5/mysql-test/t/type_bit.test	2005-02-21 18:03:00 +04:00
+++ 1.6/mysql-test/t/type_bit.test	2005-04-05 13:40:28 +05:00
@@ -112,3 +112,11 @@
 select hex(a),hex(b) from t1;
 select hex(concat(a)),hex(concat(b)) from t1;
 drop table t1;
+
+#
+# Bug #9571: problem with primary key creation
+#
+
+create table t1(a int, b bit not null);
+alter table t1 add primary key (a);
+drop table t1;
Thread
bk commit into 5.0 tree (ramil:1.1869) BUG#9571ramil5 Apr