Commit 6b001563 authored by unknown's avatar unknown

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.


sql/log_event.cc:
  WL#3228 (NDB) : RBR using different table defs on slave/master
  
  This patch changes the encoding of the 16-bit length value for
  VARCHAR field correcting an undetected type conflict.
sql/rpl_utility.h:
  WL#3228 (NDB) : RBR using different table defs on slave/master
  
  This patch changes the decoding of the 16-bit length value for
  VARCHAR field correcting an undetected type conflict.
parent 3c631d7b
...@@ -6449,8 +6449,8 @@ int Table_map_log_event::save_field_metadata() ...@@ -6449,8 +6449,8 @@ int Table_map_log_event::save_field_metadata()
} }
case MYSQL_TYPE_VARCHAR: case MYSQL_TYPE_VARCHAR:
{ {
short int *x= (short int *)&m_field_metadata[index]; char *ptr= (char *)&m_field_metadata[index];
int2store(x, m_table->s->field[i]->field_length); int2store(ptr, m_table->s->field[i]->field_length);
index= index + sizeof(short int); index= index + sizeof(short int);
break; break;
} }
......
...@@ -121,13 +121,9 @@ class table_def ...@@ -121,13 +121,9 @@ class table_def
/* /*
These types store two bytes. These types store two bytes.
*/ */
uint16 *x= (uint16 *)&field_metadata[index]; char *ptr= (char *)&field_metadata[index];
#ifdef WORDS_BIGENDIAN m_field_metadata[i]= sint2korr(ptr);
m_field_metadata[i]= sint2korr(x); index= index + sizeof(short int);
#else
m_field_metadata[i]= *x;
#endif
index= index + sizeof(short);
break; break;
} }
case MYSQL_TYPE_NEWDECIMAL: 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