Commit d605bc56 authored by unknown's avatar unknown

WL#3915 : (NDB) master's cols > slave

Corrective patch to fix test failures in pushbuild and add assertions
to help debug rpl_extraColmaster test failures.


mysql-test/extra/rpl_tests/rpl_row_tabledefs.test:
  WL#3915 : (NDB) master's cols > slave
  
  Change test to omit the port numbers in the result file.
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
  WL#3915 : (NDB) master's cols > slave
  
  Corrected result file.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
  WL#3915 : (NDB) master's cols > slave
  
  Corrected result file.
sql/rpl_utility.cc:
  WL#3915 : (NDB) master's cols > slave
  
  Added assertions to assist in debugging.
parent aee08c3d
...@@ -115,7 +115,7 @@ INSERT INTO t1_nodef VALUES (1,2); ...@@ -115,7 +115,7 @@ INSERT INTO t1_nodef VALUES (1,2);
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
...@@ -135,7 +135,7 @@ sync_slave_with_master; ...@@ -135,7 +135,7 @@ sync_slave_with_master;
--echo **** On Slave **** --echo **** On Slave ****
SELECT * FROM t2; SELECT * FROM t2;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
connection master; connection master;
...@@ -147,7 +147,7 @@ INSERT INTO t4 VALUES (4); ...@@ -147,7 +147,7 @@ INSERT INTO t4 VALUES (4);
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
...@@ -161,7 +161,7 @@ INSERT INTO t5 VALUES (5,10,25); ...@@ -161,7 +161,7 @@ INSERT INTO t5 VALUES (5,10,25);
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
...@@ -175,7 +175,7 @@ INSERT INTO t6 VALUES (6,12,36); ...@@ -175,7 +175,7 @@ INSERT INTO t6 VALUES (6,12,36);
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
...@@ -184,7 +184,7 @@ connection master; ...@@ -184,7 +184,7 @@ connection master;
INSERT INTO t9 VALUES (6); INSERT INTO t9 VALUES (6);
sync_slave_with_master; sync_slave_with_master;
--replace_result $SLAVE_MYPORT SLAVE_PORT --replace_result $SLAVE_MYPORT SLAVE_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 #
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
# Testing some tables extra field that can be null and cannot be null # Testing some tables extra field that can be null and cannot be null
......
...@@ -107,7 +107,7 @@ SHOW SLAVE STATUS; ...@@ -107,7 +107,7 @@ SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
Master_Host 127.0.0.1 Master_Host 127.0.0.1
Master_User root Master_User root
Master_Port MASTER_PORT Master_Port #
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos # Read_Master_Log_Pos #
...@@ -158,7 +158,7 @@ SHOW SLAVE STATUS; ...@@ -158,7 +158,7 @@ SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
Master_Host 127.0.0.1 Master_Host 127.0.0.1
Master_User root Master_User root
Master_Port MASTER_PORT Master_Port #
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos # Read_Master_Log_Pos #
...@@ -199,7 +199,7 @@ SHOW SLAVE STATUS; ...@@ -199,7 +199,7 @@ SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
Master_Host 127.0.0.1 Master_Host 127.0.0.1
Master_User root Master_User root
Master_Port MASTER_PORT Master_Port #
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos # Read_Master_Log_Pos #
...@@ -242,7 +242,7 @@ SHOW SLAVE STATUS; ...@@ -242,7 +242,7 @@ SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
Master_Host 127.0.0.1 Master_Host 127.0.0.1
Master_User root Master_User root
Master_Port MASTER_PORT Master_Port #
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos # Read_Master_Log_Pos #
...@@ -285,7 +285,7 @@ SHOW SLAVE STATUS; ...@@ -285,7 +285,7 @@ SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
Master_Host 127.0.0.1 Master_Host 127.0.0.1
Master_User root Master_User root
Master_Port MASTER_PORT Master_Port #
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos # Read_Master_Log_Pos #
...@@ -327,7 +327,7 @@ SHOW SLAVE STATUS; ...@@ -327,7 +327,7 @@ SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
Master_Host 127.0.0.1 Master_Host 127.0.0.1
Master_User root Master_User root
Master_Port 9306 Master_Port #
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos # Read_Master_Log_Pos #
......
...@@ -107,7 +107,7 @@ SHOW SLAVE STATUS; ...@@ -107,7 +107,7 @@ SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
Master_Host 127.0.0.1 Master_Host 127.0.0.1
Master_User root Master_User root
Master_Port MASTER_PORT Master_Port #
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos # Read_Master_Log_Pos #
...@@ -158,7 +158,7 @@ SHOW SLAVE STATUS; ...@@ -158,7 +158,7 @@ SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
Master_Host 127.0.0.1 Master_Host 127.0.0.1
Master_User root Master_User root
Master_Port MASTER_PORT Master_Port #
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos # Read_Master_Log_Pos #
...@@ -199,7 +199,7 @@ SHOW SLAVE STATUS; ...@@ -199,7 +199,7 @@ SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
Master_Host 127.0.0.1 Master_Host 127.0.0.1
Master_User root Master_User root
Master_Port MASTER_PORT Master_Port #
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos # Read_Master_Log_Pos #
...@@ -242,7 +242,7 @@ SHOW SLAVE STATUS; ...@@ -242,7 +242,7 @@ SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
Master_Host 127.0.0.1 Master_Host 127.0.0.1
Master_User root Master_User root
Master_Port MASTER_PORT Master_Port #
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos # Read_Master_Log_Pos #
...@@ -285,7 +285,7 @@ SHOW SLAVE STATUS; ...@@ -285,7 +285,7 @@ SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
Master_Host 127.0.0.1 Master_Host 127.0.0.1
Master_User root Master_User root
Master_Port MASTER_PORT Master_Port #
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos # Read_Master_Log_Pos #
...@@ -327,7 +327,7 @@ SHOW SLAVE STATUS; ...@@ -327,7 +327,7 @@ SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
Master_Host 127.0.0.1 Master_Host 127.0.0.1
Master_User root Master_User root
Master_Port 9306 Master_Port #
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos # Read_Master_Log_Pos #
......
...@@ -48,8 +48,12 @@ uint32 table_def::calc_field_size(uint col, uchar *master_data) ...@@ -48,8 +48,12 @@ uint32 table_def::calc_field_size(uint col, uchar *master_data)
else else
{ {
length= m_field_metadata[col] & 0x00ff; length= m_field_metadata[col] & 0x00ff;
DBUG_ASSERT(length > 0);
if (length > 255) if (length > 255)
{
DBUG_ASSERT(uint2korr(master_data) > 0);
length= uint2korr(master_data) + 2; length= uint2korr(master_data) + 2;
}
else else
length= (uint) *master_data + 1; length= (uint) *master_data + 1;
} }
...@@ -93,13 +97,17 @@ uint32 table_def::calc_field_size(uint col, uchar *master_data) ...@@ -93,13 +97,17 @@ uint32 table_def::calc_field_size(uint col, uchar *master_data)
{ {
uint from_len= (m_field_metadata[col] >> 8U) & 0x00ff; uint from_len= (m_field_metadata[col] >> 8U) & 0x00ff;
uint from_bit_len= m_field_metadata[col] & 0x00ff; uint from_bit_len= m_field_metadata[col] & 0x00ff;
DBUG_ASSERT(from_len >= 0 && from_bit_len >= 0 && from_bit_len <= 7);
length= from_len + ((from_bit_len > 0) ? 1 : 0); length= from_len + ((from_bit_len > 0) ? 1 : 0);
break; break;
} }
case MYSQL_TYPE_VARCHAR: case MYSQL_TYPE_VARCHAR:
{
length= m_field_metadata[col] > 255 ? 2 : 1; // c&p of Field_varstring::data_length() length= m_field_metadata[col] > 255 ? 2 : 1; // c&p of Field_varstring::data_length()
DBUG_ASSERT(uint2korr(master_data) > 0);
length+= length == 1 ? (uint32) *master_data : uint2korr(master_data); length+= length == 1 ? (uint32) *master_data : uint2korr(master_data);
break; break;
}
case MYSQL_TYPE_TINY_BLOB: case MYSQL_TYPE_TINY_BLOB:
case MYSQL_TYPE_MEDIUM_BLOB: case MYSQL_TYPE_MEDIUM_BLOB:
case MYSQL_TYPE_LONG_BLOB: case MYSQL_TYPE_LONG_BLOB:
...@@ -113,6 +121,7 @@ uint32 table_def::calc_field_size(uint col, uchar *master_data) ...@@ -113,6 +121,7 @@ uint32 table_def::calc_field_size(uint col, uchar *master_data)
default: default:
length= -1; length= -1;
} }
DBUG_ASSERT(length >= 0);
return length; return length;
} }
......
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