List:Commits« Previous MessageNext Message »
From:justin.he Date:April 25 2007 3:56am
Subject:bk commit into 5.1 tree (Justin.He:1.2553) BUG#25431
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of justin.he. When justin.he 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-04-25 09:56:04+08:00, Justin.He@stripped +2 -0
  Bug#25431, Adding index to table with BLOB is not done on-line
  add a new method is_equal in class Field_blob to compare BLOB field when alter table

  sql/field.cc@stripped, 2007-04-25 09:56:01+08:00, Justin.He@stripped +25 -5
    add a method compare_str_field_flags in class Field_str
    add a method is_equal in class Field_blob to compare BLOB field when alter table

  sql/field.h@stripped, 2007-04-25 09:56:02+08:00, Justin.He@stripped +2 -0
    add corresponding declaration of new method in class definition

# 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:	Justin.He
# Host:	dev3-240.dev.cn.tlan
# Root:	/home/justin.he/mysql/mysql-5.1/bug25431-5.1-new-ndb-bj

--- 1.383/sql/field.cc	2007-04-25 09:56:13 +08:00
+++ 1.384/sql/field.cc	2007-04-25 09:56:13 +08:00
@@ -6159,13 +6159,21 @@
 }
 
 
+/* If one of the fields is binary and the other one isn't return 1 else 0 */
+
+bool Field_str::compare_str_field_flags(create_field *new_field, uint32 flags)
+{
+  return (((new_field->flags & (BINCMP_FLAG | BINARY_FLAG)) &&
+          !(flags & (BINCMP_FLAG | BINARY_FLAG))) ||
+         (!(new_field->flags & (BINCMP_FLAG | BINARY_FLAG)) &&
+          (flags & (BINCMP_FLAG | BINARY_FLAG))));
+}
+
+
 uint Field_str::is_equal(create_field *new_field)
 {
-  if (((new_field->flags & (BINCMP_FLAG | BINARY_FLAG)) &&
-       !(flags & (BINCMP_FLAG | BINARY_FLAG))) ||
-      (!(new_field->flags & (BINCMP_FLAG | BINARY_FLAG)) &&
-	(flags & (BINCMP_FLAG | BINARY_FLAG))))
-    return 0; /* One of the fields is binary and the other one isn't */
+  if (compare_str_field_flags(new_field, flags))
+    return 0;
 
   return ((new_field->sql_type == real_type()) &&
 	  new_field->charset == field_charset &&
@@ -7668,6 +7676,18 @@
 uint Field_blob::max_packed_col_length(uint max_length)
 {
   return (max_length > 255 ? 2 : 1)+max_length;
+}
+
+
+uint Field_blob::is_equal(create_field *new_field)
+{
+  if (compare_str_field_flags(new_field, flags))
+    return 0;
+
+  return ((new_field->sql_type == get_blob_type_from_length(max_data_length()))
+          && new_field->charset == field_charset &&
+          ((Field_blob *)new_field->field)->max_data_length() ==
+          max_data_length());
 }
 
 

--- 1.218/sql/field.h	2007-04-25 09:56:13 +08:00
+++ 1.219/sql/field.h	2007-04-25 09:56:13 +08:00
@@ -473,6 +473,7 @@
   friend class create_field;
   my_decimal *val_decimal(my_decimal *);
   virtual bool str_needs_quotes() { return TRUE; }
+  bool compare_str_field_flags(create_field *new_field, uint32 flags);
   uint is_equal(create_field *new_field);
 };
 
@@ -1325,6 +1326,7 @@
   bool has_charset(void) const
   { return charset() == &my_charset_bin ? FALSE : TRUE; }
   uint32 max_display_length();
+  uint is_equal(create_field *new_field);
 };
 
 
Thread
bk commit into 5.1 tree (Justin.He:1.2553) BUG#25431justin.he25 Apr