@@ -123,8 +123,8 @@ handlerton *spider_hton_ptr;
123
123
SPIDER_DBTON spider_dbton[SPIDER_DBTON_SIZE];
124
124
extern SPIDER_DBTON spider_dbton_mysql;
125
125
extern SPIDER_DBTON spider_dbton_mariadb;
126
- SPIDER_THREAD *spider_table_sts_threads ;
127
- SPIDER_THREAD *spider_table_crd_threads ;
126
+ SPIDER_THREAD *spider_table_sts_thread ;
127
+ SPIDER_THREAD *spider_table_crd_thread ;
128
128
extern volatile ulonglong spider_mon_table_cache_version;
129
129
extern volatile ulonglong spider_mon_table_cache_version_req;
130
130
extern ulonglong spider_conn_id;
@@ -5079,11 +5079,7 @@ int spider_share_init_sts(
5079
5079
spider_share_init_error_free (share, init_share, true );
5080
5080
DBUG_RETURN (error_num);
5081
5081
}
5082
- share->sts_thread =
5083
- &spider_table_sts_threads[my_calc_hash (&spider_open_tables,
5084
- (uchar *) table_name,
5085
- (uint) strlen (table_name)) %
5086
- spider_param_table_sts_thread_count ()];
5082
+ share->sts_thread = spider_table_sts_thread;
5087
5083
share->sts_spider_init = TRUE ;
5088
5084
DBUG_RETURN (0 );
5089
5085
}
@@ -5104,11 +5100,7 @@ int spider_share_init_crd(
5104
5100
spider_share_init_error_free (share, init_share, true );
5105
5101
DBUG_RETURN (error_num);
5106
5102
}
5107
- share->crd_thread =
5108
- &spider_table_crd_threads[my_calc_hash (&spider_open_tables,
5109
- (uchar *) table_name,
5110
- (uint) strlen (table_name)) %
5111
- spider_param_table_crd_thread_count ()];
5103
+ share->crd_thread = spider_table_crd_thread;
5112
5104
share->crd_spider_init = TRUE ;
5113
5105
DBUG_RETURN (0 );
5114
5106
}
@@ -6278,17 +6270,9 @@ int spider_db_done(
6278
6270
}
6279
6271
}
6280
6272
6281
- for (roop_count = spider_param_table_crd_thread_count () - 1 ;
6282
- roop_count >= 0 ; roop_count--)
6283
- {
6284
- spider_free_crd_threads (&spider_table_crd_threads[roop_count]);
6285
- }
6286
- for (roop_count = spider_param_table_sts_thread_count () - 1 ;
6287
- roop_count >= 0 ; roop_count--)
6288
- {
6289
- spider_free_sts_threads (&spider_table_sts_threads[roop_count]);
6290
- }
6291
- spider_free (NULL , spider_table_sts_threads, MYF (0 ));
6273
+ spider_free_crd_threads (spider_table_crd_thread);
6274
+ spider_free_sts_threads (spider_table_sts_thread);
6275
+ spider_free (NULL , spider_table_sts_thread, MYF (0 ));
6292
6276
6293
6277
for (roop_count= spider_udf_table_mon_mutex_count - 1 ;
6294
6278
roop_count >= 0 ; roop_count--)
@@ -6755,34 +6739,18 @@ int spider_db_init(
6755
6739
spider_udf_table_mon_list_hash[roop_count].array .size_of_element );
6756
6740
}
6757
6741
6758
- if (!(spider_table_sts_threads = (SPIDER_THREAD *)
6742
+ if (!(spider_table_sts_thread = (SPIDER_THREAD *)
6759
6743
spider_bulk_malloc (NULL , SPD_MID_DB_INIT_12, MYF (MY_WME | MY_ZEROFILL),
6760
- &spider_table_sts_threads, (uint) (sizeof (SPIDER_THREAD) *
6761
- spider_param_table_sts_thread_count ()),
6762
- &spider_table_crd_threads, (uint) (sizeof (SPIDER_THREAD) *
6763
- spider_param_table_crd_thread_count ()),
6744
+ &spider_table_sts_thread, (uint) (sizeof (SPIDER_THREAD)),
6745
+ &spider_table_crd_thread, (uint) (sizeof (SPIDER_THREAD)),
6764
6746
NullS))
6765
6747
)
6766
6748
goto error_alloc_table_sts_crd_threads;
6767
6749
6768
- for (roop_count = 0 ;
6769
- roop_count < (int ) spider_param_table_sts_thread_count ();
6770
- roop_count++)
6771
- {
6772
- if ((error_num = spider_create_sts_threads (&spider_table_sts_threads[roop_count])))
6773
- {
6774
- goto error_init_table_sts_threads;
6775
- }
6776
- }
6777
- for (roop_count = 0 ;
6778
- roop_count < (int ) spider_param_table_crd_thread_count ();
6779
- roop_count++)
6780
- {
6781
- if ((error_num = spider_create_crd_threads (&spider_table_crd_threads[roop_count])))
6782
- {
6783
- goto error_init_table_crd_threads;
6784
- }
6785
- }
6750
+ if ((error_num = spider_create_sts_threads (spider_table_sts_thread)))
6751
+ goto error_init_table_sts_threads;
6752
+ if ((error_num = spider_create_crd_threads (spider_table_crd_thread)))
6753
+ goto error_init_table_crd_threads;
6786
6754
6787
6755
/* * Populates `spider_dbton` with available `SPIDER_DBTON`s */
6788
6756
dbton_id = 0 ;
@@ -6808,20 +6776,12 @@ int spider_db_init(
6808
6776
if (spider_dbton[roop_count].deinit )
6809
6777
spider_dbton[roop_count].deinit ();
6810
6778
}
6811
- roop_count = spider_param_table_crd_thread_count () - 1 ;
6812
6779
error_init_table_crd_threads:
6813
- for (; roop_count >= 0 ; roop_count--)
6814
- {
6815
- spider_free_crd_threads (&spider_table_crd_threads[roop_count]);
6816
- }
6817
- roop_count = spider_param_table_sts_thread_count () - 1 ;
6780
+ spider_free_crd_threads (spider_table_crd_thread);
6818
6781
error_init_table_sts_threads:
6819
- for (; roop_count >= 0 ; roop_count--)
6820
- {
6821
- spider_free_sts_threads (&spider_table_sts_threads[roop_count]);
6822
- }
6782
+ spider_free_sts_threads (spider_table_sts_thread);
6823
6783
error_alloc_table_sts_crd_threads:
6824
- spider_free (NULL , spider_table_sts_threads , MYF (0 ));
6784
+ spider_free (NULL , spider_table_sts_thread , MYF (0 ));
6825
6785
roop_count= spider_udf_table_mon_mutex_count - 1 ;
6826
6786
error_init_udf_table_mon_list_hash:
6827
6787
for (; roop_count >= 0 ; roop_count--)
0 commit comments