WL#3228 (NDB) : RBR using different table defs on slave/master

This patch corrects a incorrect type conversion during encoding and
decoding the length for VARCHAR fields.
parent 04d37af2
......@@ -6449,8 +6449,8 @@ int Table_map_log_event::save_field_metadata()
}
case MYSQL_TYPE_VARCHAR:
{
short int *x= (short int *)&m_field_metadata[index];
int2store(x, m_table->s->field[i]->field_length);
char *ptr= (char *)&m_field_metadata[index];
int2store(ptr, m_table->s->field[i]->field_length);
index= index + sizeof(short int);
break;
}
......
......@@ -121,13 +121,9 @@ class table_def
/*
These types store two bytes.
*/
uint16 *x= (uint16 *)&field_metadata[index];
#ifdef WORDS_BIGENDIAN
m_field_metadata[i]= sint2korr(x);
#else
m_field_metadata[i]= *x;
#endif
index= index + sizeof(short);
char *ptr= (char *)&field_metadata[index];
m_field_metadata[i]= sint2korr(ptr);
index= index + sizeof(short int);
break;
}
case MYSQL_TYPE_NEWDECIMAL:
......
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