MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Ramil Kalimullin Date:March 19 2010 5:48am
Subject:bzr commit into mysql-5.1-bugteam branch (ramil:3404) Bug#50946
View as plain text  
#At file:///home/ram/mysql/b50946-5.1-bugteam/ based on revid:svoj@stripped

 3404 Ramil Kalimullin	2010-03-19
      Fix for bug#50946: fast index creation still seems to copy the table 
      
      Problem: ALTER TABLE ADD INDEX may lead to table copying if there's
      numeric field(s) with non-default display width modificator specified.
      
      Fix: compare numeric field's storage lenghts when we decide whether 
      they can be considered 'equal' for table alteration purposes.
      
      Note: no test case as there's no EXPLAIN ALTER TABLE command.
      Manually tested.
     @ sql/field.cc
        Fix for bug#50946: fast index creation still seems to copy the table
          - check numeric field's pack lengths instead of it's display lenghts
        coparing fiedls equality for table alteration purposes.

    modified:
      sql/field.cc
=== modified file 'sql/field.cc'
--- a/sql/field.cc	2010-03-14 16:01:45 +0000
+++ b/sql/field.cc	2010-03-19 05:48:45 +0000
@@ -8874,14 +8874,20 @@ bool Field_num::eq_def(Field *field)
 }
 
 
+/**
+  Check whether two numeric fields can be considered 'equal' for table
+  alteration purposes. Fields are equal if they are of the same type
+  and retain the same pack length.
+*/
+
 uint Field_num::is_equal(Create_field *new_field)
 {
   return ((new_field->sql_type == real_type()) &&
-	  ((new_field->flags & UNSIGNED_FLAG) == (uint) (flags &
-							 UNSIGNED_FLAG)) &&
+          ((new_field->flags & UNSIGNED_FLAG) == 
+           (uint) (flags & UNSIGNED_FLAG)) &&
 	  ((new_field->flags & AUTO_INCREMENT_FLAG) ==
 	   (uint) (flags & AUTO_INCREMENT_FLAG)) &&
-	  (new_field->length <= max_display_length()));
+          (new_field->pack_length == pack_length()));
 }
 
 


Attachment: [text/bzr-bundle] bzr/ramil@mysql.com-20100319054845-w9i705l703yqsea4.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (ramil:3404) Bug#50946Ramil Kalimullin19 Mar