@@ -322,9 +322,6 @@ static void convert_field(Field *f, Field *result_field, Field *conv_field)
322322 @param curr_row_end
323323 Pointer to variable that will hold the value of the
324324 one-after-end position for the current row
325- @param master_reclength
326- Pointer to variable that will be set to the length of the
327- record on the master side
328325 @param row_end
329326 Pointer to variable that will hold the value of the
330327 end position for the data in the row event
@@ -340,7 +337,7 @@ static void convert_field(Field *f, Field *result_field, Field *conv_field)
340337int unpack_row (const rpl_group_info *rgi, TABLE *table, uint const colcnt,
341338 uchar const *const row_data, MY_BITMAP const *cols,
342339 uchar const **const current_row_end,
343- ulong * const master_reclength, uchar const *const row_end)
340+ uchar const *const row_end)
344341{
345342 int error;
346343 DBUG_ENTER (" unpack_row" );
@@ -357,7 +354,6 @@ int unpack_row(const rpl_group_info *rgi, TABLE *table, uint const colcnt,
357354 nothing to unpack.
358355 */
359356 *current_row_end= st.pack_ptr ;
360- *master_reclength= 0 ;
361357 DBUG_RETURN (0 );
362358 }
363359
@@ -380,12 +376,12 @@ int unpack_row(const rpl_group_info *rgi, TABLE *table, uint const colcnt,
380376 pointer is NULL, no conversions are necessary.
381377 */
382378 Field *conv_field= conv_table ? conv_table->field [i] : NULL ;
383- Field *const f= conv_field ? conv_field : result_field;
379+ Field *const field= conv_field ? conv_field : result_field;
380+ DBUG_ASSERT (field != NULL );
384381
385382 DBUG_PRINT (" debug" , (" Conversion %srequired for field '%s' (#%u)" ,
386383 conv_field ? " " : " not " ,
387384 result_field->field_name .str , i));
388- DBUG_ASSERT (f != NULL );
389385
390386 /*
391387 No need to bother about columns that does not exist: they have
@@ -396,13 +392,12 @@ int unpack_row(const rpl_group_info *rgi, TABLE *table, uint const colcnt,
396392
397393 result_field->set_has_explicit_value ();
398394
399- bool unpack_result= unpack_field (tabledef, f, &st, i);
400- if (!unpack_result)
395+ if (!unpack_field (tabledef, field, &st, i))
401396 {
402397 rgi->rli ->report (ERROR_LEVEL, ER_SLAVE_CORRUPT_EVENT,
403398 rgi->gtid_info (),
404399 " Could not read field '%s' of table '%s.%s'" ,
405- f ->field_name .str , table->s ->db .str ,
400+ field ->field_name .str , table->s ->db .str ,
406401 table->s ->table_name .str );
407402 DBUG_RETURN (HA_ERR_CORRUPT_EVENT);
408403 }
@@ -417,7 +412,7 @@ int unpack_row(const rpl_group_info *rgi, TABLE *table, uint const colcnt,
417412 and will use copy_fields set up in copy_data_between_tables
418413 */
419414 if (conv_field)
420- convert_field (f , result_field, conv_field);
415+ convert_field (field , result_field, conv_field);
421416 }
422417
423418 /*
@@ -440,14 +435,6 @@ int unpack_row(const rpl_group_info *rgi, TABLE *table, uint const colcnt,
440435 st.null_mask <<= 1 ;
441436 }
442437 }
443-
444- if (master_reclength)
445- {
446- if (result_field)
447- *master_reclength = (ulong)(result_field->ptr - table->record [0 ]);
448- else
449- *master_reclength = table->s ->reclength ;
450- }
451438 }
452439 else
453440 {
@@ -461,21 +448,17 @@ int unpack_row(const rpl_group_info *rgi, TABLE *table, uint const colcnt,
461448 {
462449 DBUG_ASSERT (bitmap_is_set (cols, i));
463450 Field *f= conv_table->field [i];
464- #ifndef DBUG_OFF
465- bool result=
466- #endif
467- unpack_field (tabledef, f, &st, i);
451+ bool result __attribute__ ((unused));
452+ result= unpack_field (tabledef, f, &st, i);
468453 DBUG_ASSERT (result);
469454 }
470455
471- for (const auto *copy=rpl_data.copy_fields ;
456+ for (const Copy_field *copy= rpl_data.copy_fields ;
472457 copy != rpl_data.copy_fields_end ; copy++)
473458 {
474459 copy->to_field ->set_has_explicit_value ();
475460 copy->do_copy (copy);
476461 }
477- if (master_reclength)
478- *master_reclength = conv_table->s ->reclength ;
479462 } // if (rpl_data.is_online_alter())
480463
481464 /*
0 commit comments