From 532c9a5061846395e6fae11bfb6de5bad9a42b6b Mon Sep 17 00:00:00 2001 From: "mskold/marty@mysql.com/linux.site" <> Date: Fri, 16 Mar 2007 08:51:29 +0100 Subject: [PATCH] bug #26591 Cluster handler does not set bits in null bytes correctly: Set filler bits and unmark the ones with values by calling field->set_notnull() --- sql/ha_ndbcluster.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index dfdcffc4e71..f3ab435beb7 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3109,11 +3109,15 @@ void ndb_unpack_record(TABLE *table, NdbValue *value, my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set); DBUG_ENTER("ndb_unpack_record"); + // Set filler bits + if (table->s->null_bytes > 0) + buf[table->s->null_bytes - 1]|= 256U - (1U << + table->s->last_null_bit_pos); // Set null flag(s) - bzero(buf, table->s->null_bytes); for ( ; field; p_field++, value++, field= *p_field) { + field->set_notnull(row_offset); if ((*value).ptr) { if (!(field->flags & BLOB_FLAG)) @@ -3123,7 +3127,7 @@ void ndb_unpack_record(TABLE *table, NdbValue *value, { if (is_null > 0) { - DBUG_PRINT("info",("[%u] NULL", + DBUG_PRINT("info",("[%u] NULL", (*value).rec->getColumn()->getColumnNo())); field->set_null(row_offset); }