1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-26247 Clean up spider_fields

Spider gbh query rewrite should get table for fields in a simple way.
Add a method spider_fields::find_table that searches its table holders
to find table for a given field. This way we will be able to get rid
of the first pass during the gbh creation where field_chains and
field_holders are created.

We also check that the field belongs to a spider table while walking
through the query, so we could remove
all_query_fields_are_query_table_members(). However, this requires an
earlier creation of the table_holder so that tables are added before
checking. We do that, and in doing so, also decouple table_holder and
spider_fields

Remove unused methods and fields. Add comments.
This commit is contained in:
Yuchen Pei
2023-10-13 14:54:45 +11:00
parent 8c1dcb2579
commit 2d1e09a77f
5 changed files with 115 additions and 339 deletions

View File

@@ -15639,8 +15639,7 @@ int spider_mbase_handler::append_from_and_tables_part(
default:
DBUG_RETURN(0);
}
fields->set_pos_to_first_table_holder();
table_holder = fields->get_next_table_holder();
table_holder = fields->get_first_table_holder();
table_list = table_holder->table->pos_in_table_list;
error_num = spider_db_mbase_utility->append_from_and_tables(
table_holder->spider, fields, str,