Commit 44ac9310 authored by unknown's avatar unknown
Browse files

ha_ndbcluster.cc:

  Bug #26591  Cluster handler does not set bits in null bytes correctly: Improved comments
ha_ndbcluster_binlog.cc:
  Bug #26591  Cluster handler does not set bits in null bytes correctly: Using empty_record() instead of bzero


sql/ha_ndbcluster.cc:
  Bug #26591  Cluster handler does not set bits in null bytes correctly: Improved comments
sql/ha_ndbcluster_binlog.cc:
  Bug #26591  Cluster handler does not set bits in null bytes correctly: Using empty_record() instead of bzero
parent 483ce953
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -3126,11 +3126,18 @@ 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
  /*
    Set the filler bits of the null byte, since they are
    not touched in the code below.
    
    The filler bits are the MSBs in the last null byte
  */ 
  if (table->s->null_bytes > 0)
       buf[table->s->null_bytes - 1]|= 256U - (1U <<
					       table->s->last_null_bit_pos);
  // Set null flag(s)
  /*
    Set null flag(s)
  */
  for ( ; field;
       p_field++, value++, field= *p_field)
  {
+10 −6
Original line number Diff line number Diff line
@@ -2273,9 +2273,11 @@ int ndb_add_ndb_binlog_index(THD *thd, void *_row)
    break;
  }

  // Set all fields non-null.
  if(ndb_binlog_index->s->null_bytes > 0)
    bzero(ndb_binlog_index->record[0], ndb_binlog_index->s->null_bytes);
  /*
    Intialize ndb_binlog_index->record[0]
  */
  empty_record(ndb_binlog_index);

  ndb_binlog_index->field[0]->store(row.master_log_pos);
  ndb_binlog_index->field[1]->store(row.master_log_file,
                                strlen(row.master_log_file),
@@ -3909,9 +3911,11 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
            IF_DBUG(int ret=) trans.use_table(::server_id, tbl);
            DBUG_ASSERT(ret == 0);

            // Set all fields non-null.
            if(table->s->null_bytes > 0)
              bzero(table->record[0], table->s->null_bytes);
	    /* 
	       Intialize table->record[0] 
	    */
	    empty_record(table);

            table->field[0]->store((longlong)::server_id);
            table->field[1]->store((longlong)gci);
            table->field[2]->store("", 0, &my_charset_bin);