@@ -519,6 +519,28 @@ pretty_print_str(String *packet, const char *str, int len)
519
519
}
520
520
#endif /* !MYSQL_CLIENT */
521
521
522
+ #ifndef DBUG_OFF
523
+ #define DBUG_DUMP_EVENT_BUF (B,L ) \
524
+ do { \
525
+ const uchar *_buf=(uchar*)(B); \
526
+ size_t _len=(L); \
527
+ if (_len >= LOG_EVENT_MINIMAL_HEADER_LEN) \
528
+ { \
529
+ DBUG_PRINT (" data" , (" header: timestamp:%u type:%u server_id:%u len:%u log_pos:%u flags:%u" , \
530
+ uint4korr (_buf), _buf[EVENT_TYPE_OFFSET], \
531
+ uint4korr (_buf+SERVER_ID_OFFSET), \
532
+ uint4korr (_buf+EVENT_LEN_OFFSET), \
533
+ uint4korr (_buf+LOG_POS_OFFSET), \
534
+ uint4korr (_buf+FLAGS_OFFSET))); \
535
+ DBUG_DUMP (" data" , _buf+LOG_EVENT_MINIMAL_HEADER_LEN, \
536
+ _len-LOG_EVENT_MINIMAL_HEADER_LEN); \
537
+ } \
538
+ else \
539
+ DBUG_DUMP (" data" , _buf, _len); \
540
+ } while (0 )
541
+ #else
542
+ #define DBUG_DUMP_EVENT_BUF (B,L ) do { } while (0 )
543
+ #endif
522
544
523
545
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
524
546
@@ -1433,7 +1455,7 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
1433
1455
DBUG_ENTER (" Log_event::read_log_event(char*,...)" );
1434
1456
DBUG_ASSERT (description_event != 0 );
1435
1457
DBUG_PRINT (" info" , (" binlog_version: %d" , description_event->binlog_version ));
1436
- DBUG_DUMP ( " data " , ( unsigned char *) buf, event_len);
1458
+ DBUG_DUMP_EVENT_BUF ( buf, event_len);
1437
1459
1438
1460
/* Check the integrity */
1439
1461
if (event_len < EVENT_LEN_OFFSET ||
@@ -1647,9 +1669,9 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
1647
1669
ev->crc = uint4korr (buf + (event_len));
1648
1670
}
1649
1671
1650
- DBUG_PRINT (" read_event" , (" %s(type_code: %d ; event_len: %d )" ,
1672
+ DBUG_PRINT (" read_event" , (" %s(type_code: %u ; event_len: %u )" ,
1651
1673
ev ? ev->get_type_str () : " <unknown>" ,
1652
- buf[EVENT_TYPE_OFFSET],
1674
+ (uchar) buf[EVENT_TYPE_OFFSET],
1653
1675
event_len));
1654
1676
/*
1655
1677
is_valid() are small event-specific sanity tests which are
@@ -6024,12 +6046,9 @@ Rotate_log_event::Rotate_log_event(const char* new_log_ident_arg,
6024
6046
pos(pos_arg),ident_len(ident_len_arg ? ident_len_arg :
6025
6047
(uint) strlen(new_log_ident_arg)), flags(flags_arg)
6026
6048
{
6027
- #ifndef DBUG_OFF
6028
- char buff[22 ];
6029
6049
DBUG_ENTER (" Rotate_log_event::Rotate_log_event(...,flags)" );
6030
- DBUG_PRINT (" enter" ,(" new_log_ident: %s pos: %s flags: %lu" , new_log_ident_arg,
6031
- llstr (pos_arg, buff), (ulong) flags));
6032
- #endif
6050
+ DBUG_PRINT (" enter" ,(" new_log_ident: %s pos: %llu flags: %lu" , new_log_ident_arg,
6051
+ pos_arg, (ulong) flags));
6033
6052
cache_type= EVENT_NO_CACHE;
6034
6053
if (flags & DUP_NAME)
6035
6054
new_log_ident= my_strndup (new_log_ident_arg, ident_len, MYF (MY_WME));
@@ -6098,14 +6117,11 @@ int Rotate_log_event::do_update_pos(rpl_group_info *rgi)
6098
6117
{
6099
6118
Relay_log_info *rli= rgi->rli ;
6100
6119
DBUG_ENTER (" Rotate_log_event::do_update_pos" );
6101
- #ifndef DBUG_OFF
6102
- char buf[32 ];
6103
- #endif
6104
6120
6105
6121
DBUG_PRINT (" info" , (" server_id=%lu; ::server_id=%lu" ,
6106
6122
(ulong) this ->server_id , (ulong) global_system_variables.server_id ));
6107
6123
DBUG_PRINT (" info" , (" new_log_ident: %s" , this ->new_log_ident ));
6108
- DBUG_PRINT (" info" , (" pos: %s " , llstr ( this ->pos , buf) ));
6124
+ DBUG_PRINT (" info" , (" pos: %llu " , this ->pos ));
6109
6125
6110
6126
/*
6111
6127
If we are in a transaction or in a group: the only normal case is
@@ -11192,11 +11208,9 @@ Rows_log_event::write_row(rpl_group_info *rgi,
11192
11208
if (is_auto_inc_in_extra_columns ())
11193
11209
m_table->next_number_field ->set_null ();
11194
11210
11195
- #ifndef DBUG_OFF
11196
11211
DBUG_DUMP (" record[0]" , table->record [0 ], table->s ->reclength );
11197
11212
DBUG_PRINT_BITSET (" debug" , " write_set = %s" , table->write_set );
11198
11213
DBUG_PRINT_BITSET (" debug" , " read_set = %s" , table->read_set );
11199
- #endif
11200
11214
11201
11215
if (invoke_triggers &&
11202
11216
process_triggers (TRG_EVENT_INSERT, TRG_ACTION_BEFORE, TRUE ))
@@ -11305,11 +11319,9 @@ Rows_log_event::write_row(rpl_group_info *rgi,
11305
11319
error= unpack_current_row (rgi);
11306
11320
}
11307
11321
11308
- #ifndef DBUG_OFF
11309
11322
DBUG_PRINT (" debug" ,(" preparing for update: before and after image" ));
11310
11323
DBUG_DUMP (" record[1] (before)" , table->record [1 ], table->s ->reclength );
11311
11324
DBUG_DUMP (" record[0] (after)" , table->record [0 ], table->s ->reclength );
11312
- #endif
11313
11325
11314
11326
/*
11315
11327
REPLACE is defined as either INSERT or DELETE + INSERT. If
@@ -11669,10 +11681,8 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
11669
11681
prepare_record (table, m_width, FALSE );
11670
11682
error= unpack_current_row (rgi);
11671
11683
11672
- #ifndef DBUG_OFF
11673
11684
DBUG_PRINT (" info" ,(" looking for the following record" ));
11674
11685
DBUG_DUMP (" record[0]" , table->record [0 ], table->s ->reclength );
11675
- #endif
11676
11686
11677
11687
if ((table->file ->ha_table_flags () & HA_PRIMARY_KEY_REQUIRED_FOR_POSITION) &&
11678
11688
table->s ->primary_key < MAX_KEY)
0 commit comments