[Commits] Rev 3162: field_conv.cc: added comments in file:///home/psergey/dev2/5.3-push18/

Sergey Petrunya psergey at askmonty.org
Wed Aug 17 11:32:16 EEST 2011


At file:///home/psergey/dev2/5.3-push18/

------------------------------------------------------------
revno: 3162
revision-id: psergey at askmonty.org-20110817083215-y76cx0hu0p5u44kx
parent: psergey at askmonty.org-20110817080202-5l5f2sfqiu1bmcag
committer: Sergey Petrunya <psergey at askmonty.org>
branch nick: 5.3-push18
timestamp: Wed 2011-08-17 12:32:15 +0400
message:
  field_conv.cc: added comments
  opt_range.cc: modified print_key() so that it doesn't do memory re-allocs when
  printing multipart keys over varchar columns. When it did, key printout in 
  debug trace was interrupted with my_malloc/free printouts.
=== modified file 'sql/field_conv.cc'
--- a/sql/field_conv.cc	2011-06-10 13:42:55 +0000
+++ b/sql/field_conv.cc	2011-08-17 08:32:15 +0000
@@ -204,6 +204,14 @@
 }
 
 
+/* 
+  Copy: (NULLable field) -> (NULLable field) 
+
+  note: if the record we're copying from is NULL-complemetned (i.e. 
+  from_field->table->null_row==1), it will also have all NULLable columns to be
+  set to NULLs, so we dont need to check table->null_row here.
+*/
+
 static void do_copy_null(Copy_field *copy)
 {
   if (*copy->from_null_ptr & copy->from_bit)
@@ -218,6 +226,10 @@
   }
 }
 
+/*
+  Copy: (not-NULL field in table that can be NULL-complemented) -> (NULLable 
+     field)
+*/
 
 static void do_outer_field_null(Copy_field *copy)
 {
@@ -235,6 +247,7 @@
 }
 
 
+/* Copy: (NULL-able field) -> (not NULL-able field) */
 static void do_copy_not_null(Copy_field *copy)
 {
   if (*copy->from_null_ptr & copy->from_bit)
@@ -248,6 +261,7 @@
 }
 
 
+/* Copy: (non-NULLable field) -> (NULLable field) */
 static void do_copy_maybe_null(Copy_field *copy)
 {
   *copy->to_null_ptr&= ~copy->to_bit;

=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc	2011-08-05 18:01:49 +0000
+++ b/sql/opt_range.cc	2011-08-17 08:32:15 +0000
@@ -13644,7 +13644,6 @@
 {
   char buff[1024];
   const uchar *key_end= key+used_length;
-  String tmp(buff,sizeof(buff),&my_charset_bin);
   uint store_length;
   TABLE *table= key_part->field->table;
   my_bitmap_map *old_sets[2];
@@ -13653,6 +13652,7 @@
 
   for (; key < key_end; key+=store_length, key_part++)
   {
+    String tmp(buff,sizeof(buff),&my_charset_bin);
     Field *field=      key_part->field;
     store_length= key_part->store_length;
 



More information about the commits mailing list