@@ -10330,13 +10330,15 @@ int spider_mysql_handler::show_table_status(
10330
10330
ulonglong auto_increment_value = 0 ;
10331
10331
DBUG_ENTER (" spider_mysql_handler::show_table_status" );
10332
10332
DBUG_PRINT (" info" ,(" spider sts_mode=%d" , sts_mode));
10333
+
10333
10334
if (sts_mode == 1 )
10334
10335
{
10335
10336
pthread_mutex_lock (&conn->mta_conn_mutex );
10336
10337
SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
10337
10338
conn->need_mon = &spider->need_mons [link_idx];
10338
10339
conn->mta_conn_mutex_lock_already = TRUE ;
10339
10340
conn->mta_conn_mutex_unlock_later = TRUE ;
10341
+ conn->disable_connect_retry = TRUE ;
10340
10342
spider_conn_set_timeout_from_share (conn, link_idx, spider->trx ->thd ,
10341
10343
share);
10342
10344
if (
@@ -10358,6 +10360,7 @@ int spider_mysql_handler::show_table_status(
10358
10360
/* retry */
10359
10361
if ((error_num = spider_db_ping (spider, conn, link_idx)))
10360
10362
{
10363
+ conn->disable_connect_retry = FALSE ;
10361
10364
conn->mta_conn_mutex_lock_already = FALSE ;
10362
10365
conn->mta_conn_mutex_unlock_later = FALSE ;
10363
10366
SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
@@ -10366,6 +10369,7 @@ int spider_mysql_handler::show_table_status(
10366
10369
}
10367
10370
if ((error_num = spider_db_set_names (spider, conn, link_idx)))
10368
10371
{
10372
+ conn->disable_connect_retry = FALSE ;
10369
10373
conn->mta_conn_mutex_lock_already = FALSE ;
10370
10374
conn->mta_conn_mutex_unlock_later = FALSE ;
10371
10375
SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
@@ -10381,11 +10385,13 @@ int spider_mysql_handler::show_table_status(
10381
10385
-1 ,
10382
10386
&spider->need_mons [link_idx])
10383
10387
) {
10388
+ conn->disable_connect_retry = FALSE ;
10384
10389
conn->mta_conn_mutex_lock_already = FALSE ;
10385
10390
conn->mta_conn_mutex_unlock_later = FALSE ;
10386
10391
DBUG_RETURN (spider_db_errorno (conn));
10387
10392
}
10388
10393
} else {
10394
+ conn->disable_connect_retry = FALSE ;
10389
10395
conn->mta_conn_mutex_lock_already = FALSE ;
10390
10396
conn->mta_conn_mutex_unlock_later = FALSE ;
10391
10397
SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
@@ -10401,6 +10407,7 @@ int spider_mysql_handler::show_table_status(
10401
10407
request_key.next = NULL ;
10402
10408
if (spider_param_dry_access ())
10403
10409
{
10410
+ conn->disable_connect_retry = FALSE ;
10404
10411
conn->mta_conn_mutex_lock_already = FALSE ;
10405
10412
conn->mta_conn_mutex_unlock_later = FALSE ;
10406
10413
SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
@@ -10409,11 +10416,13 @@ int spider_mysql_handler::show_table_status(
10409
10416
}
10410
10417
if (!(res = conn->db_conn ->store_result (NULL , &request_key, &error_num)))
10411
10418
{
10419
+ conn->disable_connect_retry = FALSE ;
10412
10420
conn->mta_conn_mutex_lock_already = FALSE ;
10413
10421
conn->mta_conn_mutex_unlock_later = FALSE ;
10414
10422
if (error_num || (error_num = spider_db_errorno (conn)))
10415
10423
DBUG_RETURN (error_num);
10416
- else {
10424
+ else
10425
+ {
10417
10426
my_printf_error (ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM,
10418
10427
ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF (0 ),
10419
10428
mysql_share->db_names_str [spider->conn_link_idx [link_idx]].ptr (),
@@ -10422,6 +10431,7 @@ int spider_mysql_handler::show_table_status(
10422
10431
DBUG_RETURN (ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM);
10423
10432
}
10424
10433
}
10434
+ conn->disable_connect_retry = FALSE ;
10425
10435
conn->mta_conn_mutex_lock_already = FALSE ;
10426
10436
conn->mta_conn_mutex_unlock_later = FALSE ;
10427
10437
SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
@@ -10469,6 +10479,7 @@ int spider_mysql_handler::show_table_status(
10469
10479
conn->need_mon = &spider->need_mons [link_idx];
10470
10480
conn->mta_conn_mutex_lock_already = TRUE ;
10471
10481
conn->mta_conn_mutex_unlock_later = TRUE ;
10482
+ conn->disable_connect_retry = TRUE ;
10472
10483
spider_conn_set_timeout_from_share (conn, link_idx, spider->trx ->thd ,
10473
10484
share);
10474
10485
if (
@@ -10490,6 +10501,7 @@ int spider_mysql_handler::show_table_status(
10490
10501
/* retry */
10491
10502
if ((error_num = spider_db_ping (spider, conn, link_idx)))
10492
10503
{
10504
+ conn->disable_connect_retry = FALSE ;
10493
10505
conn->mta_conn_mutex_lock_already = FALSE ;
10494
10506
conn->mta_conn_mutex_unlock_later = FALSE ;
10495
10507
SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
@@ -10498,6 +10510,7 @@ int spider_mysql_handler::show_table_status(
10498
10510
}
10499
10511
if ((error_num = spider_db_set_names (spider, conn, link_idx)))
10500
10512
{
10513
+ conn->disable_connect_retry = FALSE ;
10501
10514
conn->mta_conn_mutex_lock_already = FALSE ;
10502
10515
conn->mta_conn_mutex_unlock_later = FALSE ;
10503
10516
SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
@@ -10513,11 +10526,13 @@ int spider_mysql_handler::show_table_status(
10513
10526
-1 ,
10514
10527
&spider->need_mons [link_idx])
10515
10528
) {
10529
+ conn->disable_connect_retry = FALSE ;
10516
10530
conn->mta_conn_mutex_lock_already = FALSE ;
10517
10531
conn->mta_conn_mutex_unlock_later = FALSE ;
10518
10532
DBUG_RETURN (spider_db_errorno (conn));
10519
10533
}
10520
10534
} else {
10535
+ conn->disable_connect_retry = FALSE ;
10521
10536
conn->mta_conn_mutex_lock_already = FALSE ;
10522
10537
conn->mta_conn_mutex_unlock_later = FALSE ;
10523
10538
SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
@@ -10533,6 +10548,7 @@ int spider_mysql_handler::show_table_status(
10533
10548
request_key.next = NULL ;
10534
10549
if (spider_param_dry_access ())
10535
10550
{
10551
+ conn->disable_connect_retry = FALSE ;
10536
10552
conn->mta_conn_mutex_lock_already = FALSE ;
10537
10553
conn->mta_conn_mutex_unlock_later = FALSE ;
10538
10554
SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
@@ -10541,13 +10557,15 @@ int spider_mysql_handler::show_table_status(
10541
10557
}
10542
10558
if (!(res = conn->db_conn ->store_result (NULL , &request_key, &error_num)))
10543
10559
{
10560
+ conn->disable_connect_retry = FALSE ;
10544
10561
conn->mta_conn_mutex_lock_already = FALSE ;
10545
10562
conn->mta_conn_mutex_unlock_later = FALSE ;
10546
10563
if (error_num || (error_num = spider_db_errorno (conn)))
10547
10564
DBUG_RETURN (error_num);
10548
10565
else
10549
10566
DBUG_RETURN (ER_QUERY_ON_FOREIGN_DATA_SOURCE);
10550
10567
}
10568
+ conn->disable_connect_retry = FALSE ;
10551
10569
conn->mta_conn_mutex_lock_already = FALSE ;
10552
10570
conn->mta_conn_mutex_unlock_later = FALSE ;
10553
10571
SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
@@ -10604,6 +10622,7 @@ int spider_mysql_handler::show_table_status(
10604
10622
DBUG_PRINT (" info" ,(" spider auto_increment_value=%llu" ,
10605
10623
share->lgtm_tblhnd_share ->auto_increment_value ));
10606
10624
}
10625
+
10607
10626
DBUG_RETURN (0 );
10608
10627
}
10609
10628
0 commit comments