@@ -11765,18 +11765,27 @@ Write_rows_log_event::do_exec_row(rpl_group_info *rgi)
11765
11765
{
11766
11766
DBUG_ASSERT (m_table != NULL );
11767
11767
const char *tmp= thd->get_proc_info ();
11768
- const char *message= " Write_rows_log_event::write_row()" ;
11768
+ char *tmp_db= thd->db ;
11769
+ char *message, msg[128 ];
11770
+ my_snprintf (msg, sizeof (msg)," Write_rows_log_event::write_row() on table %s" ,
11771
+ m_table->s ->table_name .str );
11772
+ thd->db = m_table->s ->db .str ;
11773
+ message= msg;
11769
11774
11770
11775
#ifdef WSREP_PROC_INFO
11771
11776
my_snprintf (thd->wsrep_info , sizeof (thd->wsrep_info ) - 1 ,
11772
- " Write_rows_log_event::write_row(%lld)" ,
11773
- (long long ) wsrep_thd_trx_seqno (thd));
11777
+ " Write_rows_log_event::write_row(%lld) on table %s " ,
11778
+ (long long ) wsrep_thd_trx_seqno (thd), m_table-> s -> table_name . str );
11774
11779
message= thd->wsrep_info ;
11775
11780
#endif /* WSREP_PROC_INFO */
11776
11781
11777
11782
thd_proc_info (thd, message);
11783
+ DBUG_EXECUTE_IF (" should_sleep_for_mdev7409" ,{
11784
+ my_sleep (500000 );
11785
+ };);
11778
11786
int error= write_row (rgi, slave_exec_mode == SLAVE_EXEC_MODE_IDEMPOTENT);
11779
11787
thd_proc_info (thd, tmp);
11788
+ thd->db = tmp_db;
11780
11789
11781
11790
if (error && !thd->is_error ())
11782
11791
{
@@ -12372,32 +12381,45 @@ int Delete_rows_log_event::do_exec_row(rpl_group_info *rgi)
12372
12381
{
12373
12382
int error;
12374
12383
const char *tmp= thd->get_proc_info ();
12375
- const char *message= " Delete_rows_log_event::find_row()" ;
12384
+ char *tmp_db= thd->db ;
12385
+ char *message, msg[128 ];
12386
+ my_snprintf (msg, sizeof (msg)," Delete_rows_log_event::find_row() on table %s" ,
12387
+ m_table->s ->table_name .str );
12388
+ thd->db = m_table->s ->db .str ;
12389
+ message= msg;
12376
12390
const bool invoke_triggers=
12377
12391
slave_run_triggers_for_rbr && !master_had_triggers && m_table->triggers ;
12378
12392
DBUG_ASSERT (m_table != NULL );
12379
12393
12380
12394
#ifdef WSREP_PROC_INFO
12381
12395
my_snprintf (thd->wsrep_info , sizeof (thd->wsrep_info ) - 1 ,
12382
- " Delete_rows_log_event::find_row(%lld)" ,
12383
- (long long ) wsrep_thd_trx_seqno (thd)) ;
12396
+ " Delete_rows_log_event::find_row(%lld) on table %s " ,
12397
+ (long long ) wsrep_thd_trx_seqno (thd), m_table-> s -> table_name . str ) ;
12384
12398
message= thd->wsrep_info ;
12385
12399
#endif /* WSREP_PROC_INFO */
12386
12400
12387
12401
thd_proc_info (thd, message);
12402
+ DBUG_EXECUTE_IF (" should_sleep_for_mdev7409" ,{
12403
+ my_sleep (500000 );
12404
+ };);
12388
12405
if (!(error= find_row (rgi)))
12389
12406
{
12390
12407
/*
12391
12408
Delete the record found, located in record[0]
12392
12409
*/
12393
- message= " Delete_rows_log_event::ha_delete_row()" ;
12410
+ my_snprintf (msg, sizeof (msg)," Delete_rows_log_event::ha_delete_row() on table %s" ,
12411
+ m_table->s ->table_name .str );
12412
+ message= msg;
12394
12413
#ifdef WSREP_PROC_INFO
12395
12414
snprintf (thd->wsrep_info , sizeof (thd->wsrep_info ) - 1 ,
12396
- " Delete_rows_log_event::ha_delete_row(%lld)" ,
12397
- (long long ) wsrep_thd_trx_seqno (thd)) ;
12415
+ " Delete_rows_log_event::ha_delete_row(%lld) on table %s " ,
12416
+ (long long ) wsrep_thd_trx_seqno (thd), m_table-> s -> table_name . str ) ;
12398
12417
message= thd->wsrep_info ;
12399
12418
#endif
12400
12419
thd_proc_info (thd, message);
12420
+ DBUG_EXECUTE_IF (" should_sleep_for_mdev7409" ,{
12421
+ my_sleep (500000 );
12422
+ };);
12401
12423
12402
12424
if (invoke_triggers &&
12403
12425
process_triggers (TRG_EVENT_DELETE, TRG_ACTION_BEFORE, FALSE ))
@@ -12414,6 +12436,7 @@ int Delete_rows_log_event::do_exec_row(rpl_group_info *rgi)
12414
12436
m_table->file ->ha_index_or_rnd_end ();
12415
12437
}
12416
12438
thd_proc_info (thd, tmp);
12439
+ thd->db = tmp_db;
12417
12440
return error;
12418
12441
}
12419
12442
@@ -12532,17 +12555,26 @@ Update_rows_log_event::do_exec_row(rpl_group_info *rgi)
12532
12555
const bool invoke_triggers=
12533
12556
slave_run_triggers_for_rbr && !master_had_triggers && m_table->triggers ;
12534
12557
const char *tmp= thd->get_proc_info ();
12535
- const char *message= " Update_rows_log_event::find_row()" ;
12558
+ char *tmp_db= thd->db ;
12559
+ char *message, msg[128 ];
12536
12560
DBUG_ASSERT (m_table != NULL );
12561
+ my_snprintf (msg, sizeof (msg)," Update_rows_log_event::find_row() on table %s" ,
12562
+ m_table->s ->table_name .str );
12563
+ thd->db = m_table->s ->db .str ;
12564
+ message= msg;
12537
12565
12538
12566
#ifdef WSREP_PROC_INFO
12539
12567
my_snprintf (thd->wsrep_info , sizeof (thd->wsrep_info ) - 1 ,
12540
- " Update_rows_log_event::find_row(%lld)" ,
12541
- (long long ) wsrep_thd_trx_seqno (thd)) ;
12568
+ " Update_rows_log_event::find_row(%lld) on table %s " ,
12569
+ (long long ) wsrep_thd_trx_seqno (thd), m_table-> s -> table_name . str ) ;
12542
12570
message= thd->wsrep_info ;
12543
12571
#endif /* WSREP_PROC_INFO */
12544
12572
12545
12573
thd_proc_info (thd, message);
12574
+ DBUG_EXECUTE_IF (" should_sleep_for_mdev7409" ,{
12575
+ my_sleep (500000 );
12576
+ };);
12577
+
12546
12578
int error= find_row (rgi);
12547
12579
if (error)
12548
12580
{
@@ -12553,6 +12585,7 @@ Update_rows_log_event::do_exec_row(rpl_group_info *rgi)
12553
12585
if ((m_curr_row= m_curr_row_end))
12554
12586
unpack_current_row (rgi, &m_cols_ai);
12555
12587
thd_proc_info (thd, tmp);
12588
+ thd->db = tmp_db;
12556
12589
return error;
12557
12590
}
12558
12591
@@ -12570,16 +12603,21 @@ Update_rows_log_event::do_exec_row(rpl_group_info *rgi)
12570
12603
store_record (m_table,record[1 ]);
12571
12604
12572
12605
m_curr_row= m_curr_row_end;
12573
- message= " Update_rows_log_event::unpack_current_row()" ;
12606
+ my_snprintf (msg, sizeof (msg)," Update_rows_log_event::unpack_current_row() on table %s" ,
12607
+ m_table->s ->table_name .str );
12608
+ message= msg;
12574
12609
#ifdef WSREP_PROC_INFO
12575
12610
my_snprintf (thd->wsrep_info , sizeof (thd->wsrep_info ) - 1 ,
12576
- " Update_rows_log_event::unpack_current_row(%lld)" ,
12577
- (long long ) wsrep_thd_trx_seqno (thd)) ;
12611
+ " Update_rows_log_event::unpack_current_row(%lld) on table %s " ,
12612
+ (long long ) wsrep_thd_trx_seqno (thd), m_table-> s -> table_name . str ) ;
12578
12613
message= thd->wsrep_info ;
12579
12614
#endif /* WSREP_PROC_INFO */
12580
12615
12581
12616
/* this also updates m_curr_row_end */
12582
12617
thd_proc_info (thd, message);
12618
+ DBUG_EXECUTE_IF (" should_sleep_for_mdev7409" ,{
12619
+ my_sleep (500000 );
12620
+ };);
12583
12621
if ((error= unpack_current_row (rgi, &m_cols_ai)))
12584
12622
goto err;
12585
12623
@@ -12597,15 +12635,20 @@ Update_rows_log_event::do_exec_row(rpl_group_info *rgi)
12597
12635
DBUG_DUMP (" new values" , m_table->record [0 ], m_table->s ->reclength );
12598
12636
#endif
12599
12637
12600
- message= " Update_rows_log_event::ha_update_row()" ;
12638
+ my_snprintf (msg, sizeof (msg)," Update_rows_log_event::ha_update_row() on table %s" ,
12639
+ m_table->s ->table_name .str );
12640
+ message= msg;
12601
12641
#ifdef WSREP_PROC_INFO
12602
12642
my_snprintf (thd->wsrep_info , sizeof (thd->wsrep_info ) - 1 ,
12603
- " Update_rows_log_event::ha_update_row(%lld)" ,
12604
- (long long ) wsrep_thd_trx_seqno (thd)) ;
12643
+ " Update_rows_log_event::ha_update_row(%lld) on table %s " ,
12644
+ (long long ) wsrep_thd_trx_seqno (thd), m_table-> s -> table_name . str ) ;
12605
12645
message= thd->wsrep_info ;
12606
12646
#endif /* WSREP_PROC_INFO */
12607
12647
12608
12648
thd_proc_info (thd, message);
12649
+ DBUG_EXECUTE_IF (" should_sleep_for_mdev7409" ,{
12650
+ my_sleep (500000 );
12651
+ };);
12609
12652
if (invoke_triggers &&
12610
12653
process_triggers (TRG_EVENT_UPDATE, TRG_ACTION_BEFORE, TRUE ))
12611
12654
{
@@ -12627,9 +12670,9 @@ Update_rows_log_event::do_exec_row(rpl_group_info *rgi)
12627
12670
process_triggers (TRG_EVENT_UPDATE, TRG_ACTION_AFTER, TRUE ))
12628
12671
error= HA_ERR_GENERIC; // in case if error is not set yet
12629
12672
12630
- thd_proc_info (thd, tmp);
12631
-
12632
12673
err:
12674
+ thd_proc_info (thd, tmp);
12675
+ thd->db = tmp_db;
12633
12676
m_table->file ->ha_index_or_rnd_end ();
12634
12677
return error;
12635
12678
}
0 commit comments