Commit d3a6ed05 authored by Kentoku SHIBA's avatar Kentoku SHIBA

fix divided lock table issue of Spider

parent 418f1611
...@@ -1166,6 +1166,26 @@ THR_LOCK_DATA **ha_spider::store_lock( ...@@ -1166,6 +1166,26 @@ THR_LOCK_DATA **ha_spider::store_lock(
!spider_param_local_lock_table(thd) !spider_param_local_lock_table(thd)
) { ) {
wide_handler->lock_table_type = 1; wide_handler->lock_table_type = 1;
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (partition_handler_share && partition_handler_share->handlers)
{
uint roop_count;
for (roop_count = 0; roop_count < partition_handler_share->no_parts;
++roop_count)
{
if (unlikely((store_error_num =
partition_handler_share->handlers[roop_count]->
append_lock_tables_list())))
{
break;
}
}
} else {
#endif
store_error_num = append_lock_tables_list();
#ifdef WITH_PARTITION_STORAGE_ENGINE
}
#endif
} }
} else { } else {
DBUG_PRINT("info",("spider default lock route")); DBUG_PRINT("info",("spider default lock route"));
...@@ -1181,6 +1201,27 @@ THR_LOCK_DATA **ha_spider::store_lock( ...@@ -1181,6 +1201,27 @@ THR_LOCK_DATA **ha_spider::store_lock(
spider_param_semi_table_lock(thd, wide_handler->semi_table_lock) spider_param_semi_table_lock(thd, wide_handler->semi_table_lock)
) { ) {
wide_handler->lock_table_type = 2; wide_handler->lock_table_type = 2;
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (partition_handler_share && partition_handler_share->handlers)
{
uint roop_count;
for (roop_count = 0;
roop_count < partition_handler_share->no_parts;
++roop_count)
{
if (unlikely((store_error_num =
partition_handler_share->handlers[roop_count]->
append_lock_tables_list())))
{
break;
}
}
} else {
#endif
store_error_num = append_lock_tables_list();
#ifdef WITH_PARTITION_STORAGE_ENGINE
}
#endif
} }
} }
if ( if (
...@@ -16014,10 +16055,10 @@ int ha_spider::set_union_table_name_pos_sql() ...@@ -16014,10 +16055,10 @@ int ha_spider::set_union_table_name_pos_sql()
DBUG_RETURN(0); DBUG_RETURN(0);
} }
int ha_spider::lock_tables() int ha_spider::append_lock_tables_list()
{ {
int error_num, roop_count; int error_num, roop_count;
DBUG_ENTER("ha_spider::lock_tables"); DBUG_ENTER("ha_spider::append_lock_tables_list");
DBUG_PRINT("info",("spider lock_table_type=%u", DBUG_PRINT("info",("spider lock_table_type=%u",
wide_handler->lock_table_type)); wide_handler->lock_table_type));
...@@ -16081,6 +16122,15 @@ int ha_spider::lock_tables() ...@@ -16081,6 +16122,15 @@ int ha_spider::lock_tables()
} }
} }
} }
DBUG_RETURN(0);
}
int ha_spider::lock_tables()
{
int error_num, roop_count;
DBUG_ENTER("ha_spider::lock_tables");
DBUG_PRINT("info",("spider lock_table_type=%u",
wide_handler->lock_table_type));
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
if ((conn_kinds & SPIDER_CONN_KIND_MYSQL)) if ((conn_kinds & SPIDER_CONN_KIND_MYSQL))
......
...@@ -1237,6 +1237,7 @@ class ha_spider: public handler ...@@ -1237,6 +1237,7 @@ class ha_spider: public handler
#endif #endif
int init_union_table_name_pos_sql(); int init_union_table_name_pos_sql();
int set_union_table_name_pos_sql(); int set_union_table_name_pos_sql();
int append_lock_tables_list();
int lock_tables(); int lock_tables();
int dml_init(); int dml_init();
#ifdef HA_CAN_BULK_ACCESS #ifdef HA_CAN_BULK_ACCESS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment