mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-31673 MDEV-29502 Remove spider_db_handler::need_lock_before_set_sql_for_exec
This function trivially returns false
This commit is contained in:
@@ -2332,25 +2332,12 @@ int ha_spider::index_read_map_internal(
|
|||||||
#endif
|
#endif
|
||||||
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id];
|
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num = dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
if ((error_num = dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
#ifdef HA_CAN_BULK_ACCESS
|
||||||
if (
|
if (
|
||||||
@@ -2842,25 +2829,12 @@ int ha_spider::index_read_last_map_internal(
|
|||||||
#endif
|
#endif
|
||||||
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id];
|
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num = dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
if ((error_num = dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
#ifdef HA_CAN_BULK_ACCESS
|
||||||
if (is_bulk_access_clone)
|
if (is_bulk_access_clone)
|
||||||
@@ -3326,26 +3300,13 @@ int ha_spider::index_first_internal(
|
|||||||
#endif
|
#endif
|
||||||
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id];
|
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num =
|
if ((error_num =
|
||||||
dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
#ifdef HA_CAN_BULK_ACCESS
|
||||||
if (is_bulk_access_clone)
|
if (is_bulk_access_clone)
|
||||||
@@ -3728,26 +3689,13 @@ int ha_spider::index_last_internal(
|
|||||||
#endif
|
#endif
|
||||||
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id];
|
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num =
|
if ((error_num =
|
||||||
dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
#ifdef HA_CAN_BULK_ACCESS
|
||||||
if (is_bulk_access_clone)
|
if (is_bulk_access_clone)
|
||||||
@@ -4190,25 +4138,12 @@ int ha_spider::read_range_first_internal(
|
|||||||
#endif
|
#endif
|
||||||
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id];
|
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num = dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
if ((error_num = dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
#ifdef HA_CAN_BULK_ACCESS
|
||||||
if (is_bulk_access_clone)
|
if (is_bulk_access_clone)
|
||||||
@@ -4893,26 +4828,13 @@ int ha_spider::read_multi_range_first_internal(
|
|||||||
#endif
|
#endif
|
||||||
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id];
|
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num =
|
if ((error_num =
|
||||||
dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
#ifdef HA_CAN_BULK_ACCESS
|
||||||
if (is_bulk_access_clone)
|
if (is_bulk_access_clone)
|
||||||
@@ -5717,26 +5639,13 @@ int ha_spider::read_multi_range_first_internal(
|
|||||||
#endif
|
#endif
|
||||||
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id];
|
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num =
|
if ((error_num =
|
||||||
dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
sql_type &= ~SPIDER_SQL_TYPE_TMP_SQL;
|
sql_type &= ~SPIDER_SQL_TYPE_TMP_SQL;
|
||||||
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
#ifdef HA_CAN_BULK_ACCESS
|
||||||
@@ -6393,26 +6302,13 @@ int ha_spider::read_multi_range_next(
|
|||||||
#endif
|
#endif
|
||||||
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id];
|
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num =
|
if ((error_num =
|
||||||
dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
#ifdef HA_CAN_BULK_ACCESS
|
||||||
if (is_bulk_access_clone)
|
if (is_bulk_access_clone)
|
||||||
@@ -7212,26 +7108,13 @@ int ha_spider::read_multi_range_next(
|
|||||||
#endif
|
#endif
|
||||||
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id];
|
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num =
|
if ((error_num =
|
||||||
dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
sql_type &= ~SPIDER_SQL_TYPE_TMP_SQL;
|
sql_type &= ~SPIDER_SQL_TYPE_TMP_SQL;
|
||||||
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
#ifdef HA_CAN_BULK_ACCESS
|
||||||
@@ -7894,26 +7777,13 @@ int ha_spider::rnd_next_internal(
|
|||||||
}
|
}
|
||||||
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id];
|
spider_db_handler *dbton_hdl = dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num =
|
if ((error_num =
|
||||||
dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
||||||
conn->need_mon = &need_mons[roop_count];
|
conn->need_mon = &need_mons[roop_count];
|
||||||
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
||||||
@@ -8524,29 +8394,13 @@ int ha_spider::ft_read_internal(
|
|||||||
spider_db_handler *dbton_hdl = dbton_handler[dbton_id];
|
spider_db_handler *dbton_hdl = dbton_handler[dbton_id];
|
||||||
SPIDER_CONN *conn = conns[roop_count];
|
SPIDER_CONN *conn = conns[roop_count];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_SELECT_SQL))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num = dbton_hdl->set_sql_for_exec(
|
if ((error_num = dbton_hdl->set_sql_for_exec(
|
||||||
SPIDER_SQL_TYPE_SELECT_SQL, roop_count)))
|
SPIDER_SQL_TYPE_SELECT_SQL, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_SELECT_SQL))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_SELECT_SQL))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
conn->need_mon = &need_mons[roop_count];
|
conn->need_mon = &need_mons[roop_count];
|
||||||
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
||||||
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
|
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
|
||||||
@@ -13313,29 +13167,13 @@ int ha_spider::drop_tmp_tables()
|
|||||||
spider_db_handler *dbton_hdl = dbton_handler[dbton_id];
|
spider_db_handler *dbton_hdl = dbton_handler[dbton_id];
|
||||||
SPIDER_CONN *conn = conns[roop_count];
|
SPIDER_CONN *conn = conns[roop_count];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_TMP_SQL))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num = dbton_hdl->set_sql_for_exec(
|
if ((error_num = dbton_hdl->set_sql_for_exec(
|
||||||
SPIDER_SQL_TYPE_TMP_SQL, roop_count)))
|
SPIDER_SQL_TYPE_TMP_SQL, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_TMP_SQL))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_TMP_SQL))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
conn->need_mon = &need_mon;
|
conn->need_mon = &need_mon;
|
||||||
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
||||||
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
|
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
|
||||||
|
@@ -2636,11 +2636,6 @@ void *spider_bg_conn_action(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_handler->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if (spider->use_fields)
|
if (spider->use_fields)
|
||||||
{
|
{
|
||||||
if ((error_num = dbton_handler->set_sql_for_exec(sql_type,
|
if ((error_num = dbton_handler->set_sql_for_exec(sql_type,
|
||||||
@@ -2659,11 +2654,8 @@ void *spider_bg_conn_action(
|
|||||||
strmov(result_list->bgs_error_msg, spider_stmt_da_message(thd));
|
strmov(result_list->bgs_error_msg, spider_stmt_da_message(thd));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!dbton_handler->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
sql_type &= ~SPIDER_SQL_TYPE_TMP_SQL;
|
sql_type &= ~SPIDER_SQL_TYPE_TMP_SQL;
|
||||||
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
#ifdef HA_CAN_BULK_ACCESS
|
||||||
|
@@ -4770,27 +4770,14 @@ int spider_db_seek_next(
|
|||||||
spider_db_handler *dbton_handler =
|
spider_db_handler *dbton_handler =
|
||||||
spider->dbton_handler[conn->dbton_id];
|
spider->dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_handler->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num = dbton_handler->set_sql_for_exec(sql_type,
|
if ((error_num = dbton_handler->set_sql_for_exec(sql_type,
|
||||||
link_idx)))
|
link_idx)))
|
||||||
{
|
{
|
||||||
if (dbton_handler->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_PRINT("info",("spider error_num 6=%d", error_num));
|
DBUG_PRINT("info",("spider error_num 6=%d", error_num));
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_handler->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
conn->need_mon = &spider->need_mons[link_idx];
|
conn->need_mon = &spider->need_mons[link_idx];
|
||||||
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
||||||
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
|
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
|
||||||
@@ -4878,27 +4865,14 @@ int spider_db_seek_next(
|
|||||||
spider_db_handler *dbton_handler =
|
spider_db_handler *dbton_handler =
|
||||||
spider->dbton_handler[conn->dbton_id];
|
spider->dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_handler->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num = dbton_handler->set_sql_for_exec(sql_type,
|
if ((error_num = dbton_handler->set_sql_for_exec(sql_type,
|
||||||
roop_count)))
|
roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_handler->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_PRINT("info",("spider error_num 6=%d", error_num));
|
DBUG_PRINT("info",("spider error_num 6=%d", error_num));
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_handler->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
conn->need_mon = &spider->need_mons[roop_count];
|
conn->need_mon = &spider->need_mons[roop_count];
|
||||||
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
||||||
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
|
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
|
||||||
@@ -5149,25 +5123,12 @@ int spider_db_seek_last(
|
|||||||
conn = spider->conns[roop_count];
|
conn = spider->conns[roop_count];
|
||||||
spider_db_handler *dbton_handler = spider->dbton_handler[conn->dbton_id];
|
spider_db_handler *dbton_handler = spider->dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_handler->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num = dbton_handler->set_sql_for_exec(sql_type, roop_count)))
|
if ((error_num = dbton_handler->set_sql_for_exec(sql_type, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_handler->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_handler->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
||||||
conn->need_mon = &spider->need_mons[roop_count];
|
conn->need_mon = &spider->need_mons[roop_count];
|
||||||
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
||||||
@@ -5366,25 +5327,12 @@ int spider_db_seek_last(
|
|||||||
conn = spider->conns[roop_count];
|
conn = spider->conns[roop_count];
|
||||||
spider_db_handler *dbton_handler = spider->dbton_handler[conn->dbton_id];
|
spider_db_handler *dbton_handler = spider->dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_handler->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num = dbton_handler->set_sql_for_exec(sql_type, roop_count)))
|
if ((error_num = dbton_handler->set_sql_for_exec(sql_type, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_handler->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_handler->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
|
||||||
conn->need_mon = &spider->need_mons[roop_count];
|
conn->need_mon = &spider->need_mons[roop_count];
|
||||||
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
||||||
@@ -6227,26 +6175,11 @@ int spider_db_bulk_insert(
|
|||||||
conn = spider->conns[roop_count2];
|
conn = spider->conns[roop_count2];
|
||||||
dbton_handler = spider->dbton_handler[conn->dbton_id];
|
dbton_handler = spider->dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_handler->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num = dbton_handler->set_sql_for_exec(sql_type,
|
if ((error_num = dbton_handler->set_sql_for_exec(sql_type,
|
||||||
roop_count2)))
|
roop_count2)))
|
||||||
{
|
|
||||||
if (dbton_handler->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
|
||||||
if (!dbton_handler->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
|
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
|
||||||
} else {
|
} else {
|
||||||
sql_type = SPIDER_SQL_TYPE_INSERT_HS;
|
sql_type = SPIDER_SQL_TYPE_INSERT_HS;
|
||||||
@@ -6718,29 +6651,13 @@ int spider_db_bulk_update_size_limit(
|
|||||||
conn = spider->conns[roop_count];
|
conn = spider->conns[roop_count];
|
||||||
spider_db_handler *dbton_hdl = spider->dbton_handler[conn->dbton_id];
|
spider_db_handler *dbton_hdl = spider->dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_BULK_UPDATE_SQL))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num = dbton_hdl->set_sql_for_exec(
|
if ((error_num = dbton_hdl->set_sql_for_exec(
|
||||||
SPIDER_SQL_TYPE_BULK_UPDATE_SQL, roop_count)))
|
SPIDER_SQL_TYPE_BULK_UPDATE_SQL, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_BULK_UPDATE_SQL))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_BULK_UPDATE_SQL))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
if ((error_num = spider_db_query_for_bulk_update(
|
if ((error_num = spider_db_query_for_bulk_update(
|
||||||
spider, conn, roop_count, &dup_key_found)))
|
spider, conn, roop_count, &dup_key_found)))
|
||||||
{
|
{
|
||||||
@@ -6814,33 +6731,17 @@ int spider_db_bulk_update_end(
|
|||||||
conn = spider->conns[roop_count];
|
conn = spider->conns[roop_count];
|
||||||
spider_db_handler *dbton_hdl = spider->dbton_handler[conn->dbton_id];
|
spider_db_handler *dbton_hdl = spider->dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_BULK_UPDATE_SQL))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num = dbton_hdl->set_sql_for_exec(
|
if ((error_num = dbton_hdl->set_sql_for_exec(
|
||||||
SPIDER_SQL_TYPE_BULK_UPDATE_SQL, roop_count)))
|
SPIDER_SQL_TYPE_BULK_UPDATE_SQL, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_BULK_UPDATE_SQL))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
if (error_num == ER_SPIDER_COND_SKIP_NUM)
|
if (error_num == ER_SPIDER_COND_SKIP_NUM)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_BULK_UPDATE_SQL))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
if ((error_num = spider_db_query_for_bulk_update(
|
if ((error_num = spider_db_query_for_bulk_update(
|
||||||
spider, conn, roop_count, dup_key_found)))
|
spider, conn, roop_count, dup_key_found)))
|
||||||
{
|
{
|
||||||
@@ -6873,29 +6774,13 @@ int spider_db_bulk_update_end(
|
|||||||
conn = spider->conns[roop_count];
|
conn = spider->conns[roop_count];
|
||||||
spider_db_handler *dbton_hdl = spider->dbton_handler[conn->dbton_id];
|
spider_db_handler *dbton_hdl = spider->dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_BULK_UPDATE_SQL))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num = dbton_hdl->set_sql_for_exec(
|
if ((error_num = dbton_hdl->set_sql_for_exec(
|
||||||
SPIDER_SQL_TYPE_BULK_UPDATE_SQL, roop_count)))
|
SPIDER_SQL_TYPE_BULK_UPDATE_SQL, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_BULK_UPDATE_SQL))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_BULK_UPDATE_SQL))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
if ((error_num = spider_db_query_for_bulk_update(
|
if ((error_num = spider_db_query_for_bulk_update(
|
||||||
spider, conn, roop_count, dup_key_found)))
|
spider, conn, roop_count, dup_key_found)))
|
||||||
{
|
{
|
||||||
@@ -6971,29 +6856,13 @@ int spider_db_update(
|
|||||||
conn->ignore_dup_key = spider->ignore_dup_key;
|
conn->ignore_dup_key = spider->ignore_dup_key;
|
||||||
#endif
|
#endif
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_UPDATE_SQL))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num = dbton_hdl->set_sql_for_exec(
|
if ((error_num = dbton_hdl->set_sql_for_exec(
|
||||||
SPIDER_SQL_TYPE_UPDATE_SQL, roop_count)))
|
SPIDER_SQL_TYPE_UPDATE_SQL, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_UPDATE_SQL))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_UPDATE_SQL))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
conn->need_mon = &spider->need_mons[roop_count];
|
conn->need_mon = &spider->need_mons[roop_count];
|
||||||
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
||||||
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
|
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
|
||||||
@@ -7320,25 +7189,12 @@ int spider_db_direct_update(
|
|||||||
#endif
|
#endif
|
||||||
spider_db_handler *dbton_hdl = spider->dbton_handler[conn->dbton_id];
|
spider_db_handler *dbton_hdl = spider->dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num = dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
if ((error_num = dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
#ifdef HA_CAN_BULK_ACCESS
|
||||||
if (spider->is_bulk_access_clone)
|
if (spider->is_bulk_access_clone)
|
||||||
{
|
{
|
||||||
@@ -7596,25 +7452,12 @@ int spider_db_direct_update(
|
|||||||
sql_type = SPIDER_SQL_TYPE_UPDATE_SQL;
|
sql_type = SPIDER_SQL_TYPE_UPDATE_SQL;
|
||||||
spider_db_handler *dbton_hdl = spider->dbton_handler[conn->dbton_id];
|
spider_db_handler *dbton_hdl = spider->dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num = dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
if ((error_num = dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
#ifdef HA_CAN_BULK_ACCESS
|
||||||
if (spider->is_bulk_access_clone)
|
if (spider->is_bulk_access_clone)
|
||||||
{
|
{
|
||||||
@@ -7879,29 +7722,13 @@ int spider_db_delete(
|
|||||||
conn = spider->conns[roop_count];
|
conn = spider->conns[roop_count];
|
||||||
spider_db_handler *dbton_hdl = spider->dbton_handler[conn->dbton_id];
|
spider_db_handler *dbton_hdl = spider->dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_DELETE_SQL))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num = dbton_hdl->set_sql_for_exec(
|
if ((error_num = dbton_hdl->set_sql_for_exec(
|
||||||
SPIDER_SQL_TYPE_DELETE_SQL, roop_count)))
|
SPIDER_SQL_TYPE_DELETE_SQL, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_DELETE_SQL))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_DELETE_SQL))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
||||||
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
|
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
|
||||||
conn->mta_conn_mutex_lock_already = TRUE;
|
conn->mta_conn_mutex_lock_already = TRUE;
|
||||||
@@ -8036,25 +7863,12 @@ int spider_db_direct_delete(
|
|||||||
#endif
|
#endif
|
||||||
spider_db_handler *dbton_hdl = spider->dbton_handler[conn->dbton_id];
|
spider_db_handler *dbton_hdl = spider->dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num = dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
if ((error_num = dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
#ifdef HA_CAN_BULK_ACCESS
|
||||||
if (spider->is_bulk_access_clone)
|
if (spider->is_bulk_access_clone)
|
||||||
{
|
{
|
||||||
@@ -8272,25 +8086,12 @@ int spider_db_direct_delete(
|
|||||||
sql_type = SPIDER_SQL_TYPE_DELETE_SQL;
|
sql_type = SPIDER_SQL_TYPE_DELETE_SQL;
|
||||||
spider_db_handler *dbton_hdl = spider->dbton_handler[conn->dbton_id];
|
spider_db_handler *dbton_hdl = spider->dbton_handler[conn->dbton_id];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num = dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
if ((error_num = dbton_hdl->set_sql_for_exec(sql_type, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(sql_type))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
#ifdef HA_CAN_BULK_ACCESS
|
||||||
if (spider->is_bulk_access_clone)
|
if (spider->is_bulk_access_clone)
|
||||||
{
|
{
|
||||||
@@ -8421,29 +8222,13 @@ int spider_db_delete_all_rows(
|
|||||||
spider_db_handler *dbton_hdl = spider->dbton_handler[dbton_id];
|
spider_db_handler *dbton_hdl = spider->dbton_handler[dbton_id];
|
||||||
conn = spider->conns[roop_count];
|
conn = spider->conns[roop_count];
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_DELETE_SQL))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num = dbton_hdl->set_sql_for_exec(
|
if ((error_num = dbton_hdl->set_sql_for_exec(
|
||||||
SPIDER_SQL_TYPE_DELETE_SQL, roop_count)))
|
SPIDER_SQL_TYPE_DELETE_SQL, roop_count)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_DELETE_SQL))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_DELETE_SQL))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
conn->need_mon = &spider->need_mons[roop_count];
|
conn->need_mon = &spider->need_mons[roop_count];
|
||||||
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
||||||
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
|
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
|
||||||
|
@@ -1633,9 +1633,6 @@ public:
|
|||||||
SPIDER_HS_STRING_REF &info
|
SPIDER_HS_STRING_REF &info
|
||||||
) = 0;
|
) = 0;
|
||||||
#endif
|
#endif
|
||||||
virtual bool need_lock_before_set_sql_for_exec(
|
|
||||||
ulong sql_type
|
|
||||||
) = 0;
|
|
||||||
#ifdef SPIDER_HAS_GROUP_BY_HANDLER
|
#ifdef SPIDER_HAS_GROUP_BY_HANDLER
|
||||||
virtual int set_sql_for_exec(
|
virtual int set_sql_for_exec(
|
||||||
ulong sql_type,
|
ulong sql_type,
|
||||||
|
@@ -13538,14 +13538,6 @@ int spider_mbase_handler::push_back_upds(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool spider_mbase_handler::need_lock_before_set_sql_for_exec(
|
|
||||||
ulong sql_type
|
|
||||||
) {
|
|
||||||
DBUG_ENTER("spider_mbase_handler::need_lock_before_set_sql_for_exec");
|
|
||||||
DBUG_PRINT("info",("spider this=%p", this));
|
|
||||||
DBUG_RETURN(FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef SPIDER_HAS_GROUP_BY_HANDLER
|
#ifdef SPIDER_HAS_GROUP_BY_HANDLER
|
||||||
int spider_mbase_handler::set_sql_for_exec(
|
int spider_mbase_handler::set_sql_for_exec(
|
||||||
ulong sql_type,
|
ulong sql_type,
|
||||||
|
@@ -1476,9 +1476,6 @@ public:
|
|||||||
SPIDER_HS_STRING_REF &info
|
SPIDER_HS_STRING_REF &info
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
bool need_lock_before_set_sql_for_exec(
|
|
||||||
ulong sql_type
|
|
||||||
);
|
|
||||||
#ifdef SPIDER_HAS_GROUP_BY_HANDLER
|
#ifdef SPIDER_HAS_GROUP_BY_HANDLER
|
||||||
int set_sql_for_exec(
|
int set_sql_for_exec(
|
||||||
ulong sql_type,
|
ulong sql_type,
|
||||||
|
@@ -1411,30 +1411,14 @@ int spider_group_by_handler::init_scan()
|
|||||||
} else {
|
} else {
|
||||||
#endif
|
#endif
|
||||||
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_SELECT_SQL))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
}
|
|
||||||
if ((error_num =
|
if ((error_num =
|
||||||
dbton_hdl->set_sql_for_exec(SPIDER_SQL_TYPE_SELECT_SQL, link_idx,
|
dbton_hdl->set_sql_for_exec(SPIDER_SQL_TYPE_SELECT_SQL, link_idx,
|
||||||
link_idx_chain)))
|
link_idx_chain)))
|
||||||
{
|
{
|
||||||
if (dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_SELECT_SQL))
|
|
||||||
{
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
|
||||||
}
|
|
||||||
DBUG_RETURN(error_num);
|
DBUG_RETURN(error_num);
|
||||||
}
|
}
|
||||||
if (!dbton_hdl->need_lock_before_set_sql_for_exec(
|
|
||||||
SPIDER_SQL_TYPE_SELECT_SQL))
|
|
||||||
{
|
|
||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
|
||||||
conn->need_mon = &spider->need_mons[link_idx];
|
conn->need_mon = &spider->need_mons[link_idx];
|
||||||
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
|
||||||
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
|
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
|
||||||
|
Reference in New Issue
Block a user