@@ -2332,25 +2332,12 @@ int ha_spider::index_read_map_internal(
2332
2332
#endif
2333
2333
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id ];
2334
2334
pthread_mutex_assert_not_owner (&conn->mta_conn_mutex );
2335
- if (dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
2336
- {
2337
- pthread_mutex_lock (&conn->mta_conn_mutex );
2338
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
2339
- }
2340
2335
if ((error_num = dbton_hdl->set_sql_for_exec (sql_type, roop_count)))
2341
2336
{
2342
- if (dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
2343
- {
2344
- SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
2345
- pthread_mutex_unlock (&conn->mta_conn_mutex );
2346
- }
2347
2337
DBUG_RETURN (error_num);
2348
2338
}
2349
- if (!dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
2350
- {
2351
- pthread_mutex_lock (&conn->mta_conn_mutex );
2352
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
2353
- }
2339
+ pthread_mutex_lock (&conn->mta_conn_mutex );
2340
+ SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
2354
2341
DBUG_PRINT (" info" ,(" spider sql_type=%lu" , sql_type));
2355
2342
#ifdef HA_CAN_BULK_ACCESS
2356
2343
if (
@@ -2842,25 +2829,12 @@ int ha_spider::index_read_last_map_internal(
2842
2829
#endif
2843
2830
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id ];
2844
2831
pthread_mutex_assert_not_owner (&conn->mta_conn_mutex );
2845
- if (dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
2846
- {
2847
- pthread_mutex_lock (&conn->mta_conn_mutex );
2848
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
2849
- }
2850
2832
if ((error_num = dbton_hdl->set_sql_for_exec (sql_type, roop_count)))
2851
2833
{
2852
- if (dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
2853
- {
2854
- SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
2855
- pthread_mutex_unlock (&conn->mta_conn_mutex );
2856
- }
2857
2834
DBUG_RETURN (error_num);
2858
2835
}
2859
- if (!dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
2860
- {
2861
- pthread_mutex_lock (&conn->mta_conn_mutex );
2862
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
2863
- }
2836
+ pthread_mutex_lock (&conn->mta_conn_mutex );
2837
+ SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
2864
2838
DBUG_PRINT (" info" ,(" spider sql_type=%lu" , sql_type));
2865
2839
#ifdef HA_CAN_BULK_ACCESS
2866
2840
if (is_bulk_access_clone)
@@ -3326,26 +3300,13 @@ int ha_spider::index_first_internal(
3326
3300
#endif
3327
3301
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id ];
3328
3302
pthread_mutex_assert_not_owner (&conn->mta_conn_mutex );
3329
- if (dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
3330
- {
3331
- pthread_mutex_lock (&conn->mta_conn_mutex );
3332
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
3333
- }
3334
3303
if ((error_num =
3335
3304
dbton_hdl->set_sql_for_exec (sql_type, roop_count)))
3336
3305
{
3337
- if (dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
3338
- {
3339
- SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
3340
- pthread_mutex_unlock (&conn->mta_conn_mutex );
3341
- }
3342
3306
DBUG_RETURN (error_num);
3343
3307
}
3344
- if (!dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
3345
- {
3346
- pthread_mutex_lock (&conn->mta_conn_mutex );
3347
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
3348
- }
3308
+ pthread_mutex_lock (&conn->mta_conn_mutex );
3309
+ SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
3349
3310
DBUG_PRINT (" info" ,(" spider sql_type=%lu" , sql_type));
3350
3311
#ifdef HA_CAN_BULK_ACCESS
3351
3312
if (is_bulk_access_clone)
@@ -3728,26 +3689,13 @@ int ha_spider::index_last_internal(
3728
3689
#endif
3729
3690
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id ];
3730
3691
pthread_mutex_assert_not_owner (&conn->mta_conn_mutex );
3731
- if (dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
3732
- {
3733
- pthread_mutex_lock (&conn->mta_conn_mutex );
3734
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
3735
- }
3736
3692
if ((error_num =
3737
3693
dbton_hdl->set_sql_for_exec (sql_type, roop_count)))
3738
3694
{
3739
- if (dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
3740
- {
3741
- SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
3742
- pthread_mutex_unlock (&conn->mta_conn_mutex );
3743
- }
3744
3695
DBUG_RETURN (error_num);
3745
3696
}
3746
- if (!dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
3747
- {
3748
- pthread_mutex_lock (&conn->mta_conn_mutex );
3749
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
3750
- }
3697
+ pthread_mutex_lock (&conn->mta_conn_mutex );
3698
+ SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
3751
3699
DBUG_PRINT (" info" ,(" spider sql_type=%lu" , sql_type));
3752
3700
#ifdef HA_CAN_BULK_ACCESS
3753
3701
if (is_bulk_access_clone)
@@ -4190,25 +4138,12 @@ int ha_spider::read_range_first_internal(
4190
4138
#endif
4191
4139
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id ];
4192
4140
pthread_mutex_assert_not_owner (&conn->mta_conn_mutex );
4193
- if (dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
4194
- {
4195
- pthread_mutex_lock (&conn->mta_conn_mutex );
4196
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
4197
- }
4198
4141
if ((error_num = dbton_hdl->set_sql_for_exec (sql_type, roop_count)))
4199
4142
{
4200
- if (dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
4201
- {
4202
- SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
4203
- pthread_mutex_unlock (&conn->mta_conn_mutex );
4204
- }
4205
4143
DBUG_RETURN (error_num);
4206
4144
}
4207
- if (!dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
4208
- {
4209
- pthread_mutex_lock (&conn->mta_conn_mutex );
4210
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
4211
- }
4145
+ pthread_mutex_lock (&conn->mta_conn_mutex );
4146
+ SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
4212
4147
DBUG_PRINT (" info" ,(" spider sql_type=%lu" , sql_type));
4213
4148
#ifdef HA_CAN_BULK_ACCESS
4214
4149
if (is_bulk_access_clone)
@@ -4893,26 +4828,13 @@ int ha_spider::read_multi_range_first_internal(
4893
4828
#endif
4894
4829
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id ];
4895
4830
pthread_mutex_assert_not_owner (&conn->mta_conn_mutex );
4896
- if (dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
4897
- {
4898
- pthread_mutex_lock (&conn->mta_conn_mutex );
4899
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
4900
- }
4901
4831
if ((error_num =
4902
4832
dbton_hdl->set_sql_for_exec (sql_type, roop_count)))
4903
4833
{
4904
- if (dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
4905
- {
4906
- SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
4907
- pthread_mutex_unlock (&conn->mta_conn_mutex );
4908
- }
4909
4834
DBUG_RETURN (error_num);
4910
4835
}
4911
- if (!dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
4912
- {
4913
- pthread_mutex_lock (&conn->mta_conn_mutex );
4914
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
4915
- }
4836
+ pthread_mutex_lock (&conn->mta_conn_mutex );
4837
+ SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
4916
4838
DBUG_PRINT (" info" ,(" spider sql_type=%lu" , sql_type));
4917
4839
#ifdef HA_CAN_BULK_ACCESS
4918
4840
if (is_bulk_access_clone)
@@ -5717,26 +5639,13 @@ int ha_spider::read_multi_range_first_internal(
5717
5639
#endif
5718
5640
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id ];
5719
5641
pthread_mutex_assert_not_owner (&conn->mta_conn_mutex );
5720
- if (dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
5721
- {
5722
- pthread_mutex_lock (&conn->mta_conn_mutex );
5723
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
5724
- }
5725
5642
if ((error_num =
5726
5643
dbton_hdl->set_sql_for_exec (sql_type, roop_count)))
5727
5644
{
5728
- if (dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
5729
- {
5730
- SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
5731
- pthread_mutex_unlock (&conn->mta_conn_mutex );
5732
- }
5733
5645
DBUG_RETURN (error_num);
5734
5646
}
5735
- if (!dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
5736
- {
5737
- pthread_mutex_lock (&conn->mta_conn_mutex );
5738
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
5739
- }
5647
+ pthread_mutex_lock (&conn->mta_conn_mutex );
5648
+ SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
5740
5649
sql_type &= ~SPIDER_SQL_TYPE_TMP_SQL;
5741
5650
DBUG_PRINT (" info" ,(" spider sql_type=%lu" , sql_type));
5742
5651
#ifdef HA_CAN_BULK_ACCESS
@@ -6393,26 +6302,13 @@ int ha_spider::read_multi_range_next(
6393
6302
#endif
6394
6303
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id ];
6395
6304
pthread_mutex_assert_not_owner (&conn->mta_conn_mutex );
6396
- if (dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
6397
- {
6398
- pthread_mutex_lock (&conn->mta_conn_mutex );
6399
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
6400
- }
6401
6305
if ((error_num =
6402
6306
dbton_hdl->set_sql_for_exec (sql_type, roop_count)))
6403
6307
{
6404
- if (dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
6405
- {
6406
- SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
6407
- pthread_mutex_unlock (&conn->mta_conn_mutex );
6408
- }
6409
6308
DBUG_RETURN (error_num);
6410
6309
}
6411
- if (!dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
6412
- {
6413
- pthread_mutex_lock (&conn->mta_conn_mutex );
6414
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
6415
- }
6310
+ pthread_mutex_lock (&conn->mta_conn_mutex );
6311
+ SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
6416
6312
DBUG_PRINT (" info" ,(" spider sql_type=%lu" , sql_type));
6417
6313
#ifdef HA_CAN_BULK_ACCESS
6418
6314
if (is_bulk_access_clone)
@@ -7212,26 +7108,13 @@ int ha_spider::read_multi_range_next(
7212
7108
#endif
7213
7109
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id ];
7214
7110
pthread_mutex_assert_not_owner (&conn->mta_conn_mutex );
7215
- if (dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
7216
- {
7217
- pthread_mutex_lock (&conn->mta_conn_mutex );
7218
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
7219
- }
7220
7111
if ((error_num =
7221
7112
dbton_hdl->set_sql_for_exec (sql_type, roop_count)))
7222
7113
{
7223
- if (dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
7224
- {
7225
- SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
7226
- pthread_mutex_unlock (&conn->mta_conn_mutex );
7227
- }
7228
7114
DBUG_RETURN (error_num);
7229
7115
}
7230
- if (!dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
7231
- {
7232
- pthread_mutex_lock (&conn->mta_conn_mutex );
7233
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
7234
- }
7116
+ pthread_mutex_lock (&conn->mta_conn_mutex );
7117
+ SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
7235
7118
sql_type &= ~SPIDER_SQL_TYPE_TMP_SQL;
7236
7119
DBUG_PRINT (" info" ,(" spider sql_type=%lu" , sql_type));
7237
7120
#ifdef HA_CAN_BULK_ACCESS
@@ -7894,26 +7777,13 @@ int ha_spider::rnd_next_internal(
7894
7777
}
7895
7778
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id ];
7896
7779
pthread_mutex_assert_not_owner (&conn->mta_conn_mutex );
7897
- if (dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
7898
- {
7899
- pthread_mutex_lock (&conn->mta_conn_mutex );
7900
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
7901
- }
7902
7780
if ((error_num =
7903
7781
dbton_hdl->set_sql_for_exec (sql_type, roop_count)))
7904
7782
{
7905
- if (dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
7906
- {
7907
- SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
7908
- pthread_mutex_unlock (&conn->mta_conn_mutex );
7909
- }
7910
7783
DBUG_RETURN (error_num);
7911
7784
}
7912
- if (!dbton_hdl->need_lock_before_set_sql_for_exec (sql_type))
7913
- {
7914
- pthread_mutex_lock (&conn->mta_conn_mutex );
7915
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
7916
- }
7785
+ pthread_mutex_lock (&conn->mta_conn_mutex );
7786
+ SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
7917
7787
DBUG_PRINT (" info" ,(" spider sql_type=%lu" , sql_type));
7918
7788
conn->need_mon = &need_mons[roop_count];
7919
7789
DBUG_ASSERT (!conn->mta_conn_mutex_lock_already );
@@ -8524,29 +8394,13 @@ int ha_spider::ft_read_internal(
8524
8394
spider_db_handler *dbton_hdl = dbton_handler[dbton_id];
8525
8395
SPIDER_CONN *conn = conns[roop_count];
8526
8396
pthread_mutex_assert_not_owner (&conn->mta_conn_mutex );
8527
- if (dbton_hdl->need_lock_before_set_sql_for_exec (
8528
- SPIDER_SQL_TYPE_SELECT_SQL))
8529
- {
8530
- pthread_mutex_lock (&conn->mta_conn_mutex );
8531
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
8532
- }
8533
8397
if ((error_num = dbton_hdl->set_sql_for_exec (
8534
8398
SPIDER_SQL_TYPE_SELECT_SQL, roop_count)))
8535
8399
{
8536
- if (dbton_hdl->need_lock_before_set_sql_for_exec (
8537
- SPIDER_SQL_TYPE_SELECT_SQL))
8538
- {
8539
- SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
8540
- pthread_mutex_unlock (&conn->mta_conn_mutex );
8541
- }
8542
8400
DBUG_RETURN (error_num);
8543
8401
}
8544
- if (!dbton_hdl->need_lock_before_set_sql_for_exec (
8545
- SPIDER_SQL_TYPE_SELECT_SQL))
8546
- {
8547
- pthread_mutex_lock (&conn->mta_conn_mutex );
8548
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
8549
- }
8402
+ pthread_mutex_lock (&conn->mta_conn_mutex );
8403
+ SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
8550
8404
conn->need_mon = &need_mons[roop_count];
8551
8405
DBUG_ASSERT (!conn->mta_conn_mutex_lock_already );
8552
8406
DBUG_ASSERT (!conn->mta_conn_mutex_unlock_later );
@@ -13313,29 +13167,13 @@ int ha_spider::drop_tmp_tables()
13313
13167
spider_db_handler *dbton_hdl = dbton_handler[dbton_id];
13314
13168
SPIDER_CONN *conn = conns[roop_count];
13315
13169
pthread_mutex_assert_not_owner (&conn->mta_conn_mutex );
13316
- if (dbton_hdl->need_lock_before_set_sql_for_exec (
13317
- SPIDER_SQL_TYPE_TMP_SQL))
13318
- {
13319
- pthread_mutex_lock (&conn->mta_conn_mutex );
13320
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
13321
- }
13322
13170
if ((error_num = dbton_hdl->set_sql_for_exec (
13323
13171
SPIDER_SQL_TYPE_TMP_SQL, roop_count)))
13324
13172
{
13325
- if (dbton_hdl->need_lock_before_set_sql_for_exec (
13326
- SPIDER_SQL_TYPE_TMP_SQL))
13327
- {
13328
- SPIDER_CLEAR_FILE_POS (&conn->mta_conn_mutex_file_pos );
13329
- pthread_mutex_unlock (&conn->mta_conn_mutex );
13330
- }
13331
13173
DBUG_RETURN (error_num);
13332
13174
}
13333
- if (!dbton_hdl->need_lock_before_set_sql_for_exec (
13334
- SPIDER_SQL_TYPE_TMP_SQL))
13335
- {
13336
- pthread_mutex_lock (&conn->mta_conn_mutex );
13337
- SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
13338
- }
13175
+ pthread_mutex_lock (&conn->mta_conn_mutex );
13176
+ SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
13339
13177
conn->need_mon = &need_mon;
13340
13178
DBUG_ASSERT (!conn->mta_conn_mutex_lock_already );
13341
13179
DBUG_ASSERT (!conn->mta_conn_mutex_unlock_later );
0 commit comments