List:Commits« Previous MessageNext Message »
From:pekka Date:January 27 2006 7:27pm
Subject:bk commit into 5.1 tree (pekka:1.2076)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of pekka. When pekka 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.2076 06/01/27 20:27:10 pekka@stripped +2 -0
  ndb - wl#2972 fix null blobs

  sql/ha_ndbcluster.cc
    1.245 06/01/27 20:26:03 pekka@stripped +37 -14
    blobs: set_null is not enough, must also set empty buffer

  mysql-test/t/disabled.def
    1.51 06/01/27 20:26:03 pekka@stripped +1 -1
    blobs: set_null is not enough, must also set empty buffer

# 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:	pekka
# Host:	orca.ndb.mysql.com
# Root:	/space/pekka/ndb/version/my51

--- 1.50/mysql-test/t/disabled.def	2006-01-25 22:38:42 +01:00
+++ 1.51/mysql-test/t/disabled.def	2006-01-27 20:26:03 +01:00
@@ -30,6 +30,6 @@
 system_mysql_db : Needs fixing
 system_mysql_db_fix : Needs fixing
 #ndb_alter_table_row : sometimes wrong error 1015!=1046
-ndb_gis : garbled msgs from corrupt THD* + partitioning problem
+ndb_gis : garbled msgs from corrupt THD*
 
 # vim: set filetype=conf:

--- 1.244/sql/ha_ndbcluster.cc	2006-01-25 22:00:25 +01:00
+++ 1.245/sql/ha_ndbcluster.cc	2006-01-27 20:26:03 +01:00
@@ -844,14 +844,29 @@
                                 buf, (uint) blob_len));
             if (ndb_blob->readData(buf, len) != 0)
               DBUG_RETURN(-1);
+            DBUG_PRINT("info", ("blob field %d offset=%u len=%u [ptrdiff=%d]",
+                                i, offset, len, (int)ptrdiff));
             DBUG_ASSERT(len == blob_len);
             // Ugly hack assumes only ptr needs to be changed
-            field_blob->ptr += ptrdiff;
+            field_blob->ptr+= ptrdiff;
             field_blob->set_ptr(len, buf);
-            field_blob->ptr -= ptrdiff;
+            field_blob->ptr-= ptrdiff;
           }
           offset+= blob_size;
         }
+        else
+        {
+          if (loop == 1)
+          {
+            // have to set length even in this case
+            char *buf= buffer + offset;
+            uint32 len= 0;
+            field_blob->ptr+= ptrdiff;
+            field_blob->set_ptr(len, buf);
+            field_blob->ptr-= ptrdiff;
+            DBUG_PRINT("info", ("blob field %d isNull=%d", i, isNull));
+          }
+        }
       }
     }
     if (loop == 0 && offset > buffer_size)
@@ -2735,21 +2750,29 @@
       else
       {
         NdbBlob *ndb_blob= (*value).blob;
+        uint col_no = ndb_blob->getColumn()->getColumnNo();
         int isNull;
         ndb_blob->getDefined(isNull);
-        if (isNull != 0)
+        if (isNull == 1)
         {
-          uint col_no = ndb_blob->getColumn()->getColumnNo();
-          if (isNull == 1)
-          {
-            DBUG_PRINT("info",("[%u] NULL", col_no))
-            field->set_null(row_offset);
-          }
-          else
-          {
-            DBUG_PRINT("info",("[%u] UNDEFINED", col_no));
-            bitmap_clear_bit(defined, col_no);
-          }
+          DBUG_PRINT("info",("[%u] NULL", col_no))
+          field->set_null(row_offset);
+        }
+        else if (isNull == -1)
+        {
+          DBUG_PRINT("info",("[%u] UNDEFINED", col_no));
+          bitmap_clear_bit(defined, col_no);
+        }
+        else
+        {
+#ifndef DBUG_OFF
+          // pointer vas set in get_ndb_blobs_value
+          Field_blob *field_blob= (Field_blob*)field;
+          char* ptr;
+          field_blob->get_ptr(&ptr, row_offset);
+          uint32 len= field_blob->get_length(row_offset);
+          DBUG_PRINT("info",("[%u] SET ptr=%p len=%u", col_no, ptr, len));
+#endif
         }
       }
     }
Thread
bk commit into 5.1 tree (pekka:1.2076)pekka27 Jan