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
parent 70fa6a4e
......@@ -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)
{
......
......@@ -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 @@ restart:
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment