Skip to content

Commit

Permalink
MDEV-33742 Remove macro PARTITION_HAS_GET_CHILD_HANDLERS
Browse files Browse the repository at this point in the history
Similar to MDEV-27658.

Also fixing the positioning of #ifdef WITH_PARTITION_STORAGE_ENGINE
blocks and add missing ones.
  • Loading branch information
mariadb-YuchenPei committed Apr 8, 2024
1 parent 860c1ca commit e865ef6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 24 deletions.
1 change: 0 additions & 1 deletion storage/spider/spd_environ.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#define HANDLER_HAS_TOP_TABLE_FIELDS
#define HANDLER_HAS_DIRECT_UPDATE_ROWS
#define HANDLER_HAS_DIRECT_AGGREGATE
#define PARTITION_HAS_GET_CHILD_HANDLERS
#define PARTITION_HAS_GET_PART_SPEC
#define HA_EXTRA_HAS_STARTING_ORDERED_INDEX_SCAN
#define HANDLER_HAS_NEED_INFO_FOR_AUTO_INC
Expand Down
30 changes: 7 additions & 23 deletions storage/spider/spd_group_by_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1433,38 +1433,32 @@ group_by_handler *spider_create_group_by_handler(
break;
}

#ifdef WITH_PARTITION_STORAGE_ENGINE
from = query->from;
do {
DBUG_PRINT("info",("spider from=%p", from));
++table_count;
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (from->table->part_info)
{
DBUG_PRINT("info",("spider partition handler"));
#if defined(PARTITION_HAS_GET_CHILD_HANDLERS)
partition_info *part_info = from->table->part_info;
uint bits = bitmap_bits_set(&part_info->read_partitions);
DBUG_PRINT("info",("spider bits=%u", bits));
if (bits != 1)
{
DBUG_PRINT("info",("spider using multiple partitions is not supported by this feature yet"));
#else
DBUG_PRINT("info",("spider partition is not supported by this feature yet"));
#endif
DBUG_RETURN(NULL);
#if defined(PARTITION_HAS_GET_CHILD_HANDLERS)
}
#endif
}
} while ((from = from->next_local));
#endif
} while ((from = from->next_local));

if (!(table_holder= spider_create_table_holder(table_count)))
DBUG_RETURN(NULL);

table_idx = 0;
from = query->from;
#if defined(PARTITION_HAS_GET_CHILD_HANDLERS)
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (from->table->part_info)
{
partition_info *part_info = from->table->part_info;
Expand All @@ -1473,9 +1467,7 @@ group_by_handler *spider_create_group_by_handler(
handler **handlers = partition->get_child_handlers();
spider = (ha_spider *) handlers[part];
} else {
#endif
spider = (ha_spider *) from->table->file;
#if defined(PARTITION_HAS_GET_CHILD_HANDLERS)
}
#endif
share = spider->share;
Expand All @@ -1499,7 +1491,7 @@ group_by_handler *spider_create_group_by_handler(
}
while ((from = from->next_local))
{
#if defined(PARTITION_HAS_GET_CHILD_HANDLERS)
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (from->table->part_info)
{
partition_info *part_info = from->table->part_info;
Expand All @@ -1508,9 +1500,7 @@ group_by_handler *spider_create_group_by_handler(
handler **handlers = partition->get_child_handlers();
spider = (ha_spider *) handlers[part];
} else {
#endif
spider = (ha_spider *) from->table->file;
#if defined(PARTITION_HAS_GET_CHILD_HANDLERS)
}
#endif
share = spider->share;
Expand Down Expand Up @@ -1541,7 +1531,7 @@ group_by_handler *spider_create_group_by_handler(

from = query->from;
do {
#if defined(PARTITION_HAS_GET_CHILD_HANDLERS)
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (from->table->part_info)
{
partition_info *part_info = from->table->part_info;
Expand All @@ -1550,9 +1540,7 @@ group_by_handler *spider_create_group_by_handler(
handler **handlers = partition->get_child_handlers();
spider = (ha_spider *) handlers[part];
} else {
#endif
spider = (ha_spider *) from->table->file;
#if defined(PARTITION_HAS_GET_CHILD_HANDLERS)
}
#endif
share = spider->share;
Expand Down Expand Up @@ -1684,7 +1672,7 @@ group_by_handler *spider_create_group_by_handler(
goto skip_free_table_holder;

from = query->from;
#if defined(PARTITION_HAS_GET_CHILD_HANDLERS)
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (from->table->part_info)
{
partition_info *part_info = from->table->part_info;
Expand All @@ -1693,9 +1681,7 @@ group_by_handler *spider_create_group_by_handler(
handler **handlers = partition->get_child_handlers();
spider = (ha_spider *) handlers[part];
} else {
#endif
spider = (ha_spider *) from->table->file;
#if defined(PARTITION_HAS_GET_CHILD_HANDLERS)
}
#endif
share = spider->share;
Expand Down Expand Up @@ -1758,7 +1744,7 @@ group_by_handler *spider_create_group_by_handler(
{
fields->clear_conn_holder_from_conn();

#if defined(PARTITION_HAS_GET_CHILD_HANDLERS)
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (from->table->part_info)
{
partition_info *part_info = from->table->part_info;
Expand All @@ -1767,9 +1753,7 @@ group_by_handler *spider_create_group_by_handler(
handler **handlers = partition->get_child_handlers();
spider = (ha_spider *) handlers[part];
} else {
#endif
spider = (ha_spider *) from->table->file;
#if defined(PARTITION_HAS_GET_CHILD_HANDLERS)
}
#endif
share = spider->share;
Expand Down

0 comments on commit e865ef6

Please sign in to comment.