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

Merge remote-tracking branch 'github/bb-11.4-release' into bb-11.8-serg

This commit is contained in:
Sergei Golubchik
2025-04-27 11:33:27 +02:00
committed by Oleksandr Byelkin
430 changed files with 14769 additions and 6751 deletions

View File

@@ -11492,7 +11492,8 @@ st_select_lex::build_pushable_cond_for_having_pushdown(THD *thd, Item *cond)
Field_pair *get_corresponding_field_pair(Item *item,
List<Field_pair> pair_list)
{
DBUG_ASSERT(item->type() == Item::FIELD_ITEM ||
DBUG_ASSERT(item->type() == Item::DEFAULT_VALUE_ITEM ||
item->type() == Item::FIELD_ITEM ||
(item->type() == Item::REF_ITEM &&
((((Item_ref *) item)->ref_type() == Item_ref::VIEW_REF) ||
(((Item_ref *) item)->ref_type() == Item_ref::REF))));
@@ -12578,6 +12579,48 @@ bool SELECT_LEX_UNIT::explainable() const
false;
}
/**
Find the real table in prepared SELECT tree
NOTE: all SELECT must be prepared (to have leaf table list).
NOTE: it looks only for real tables (not view or derived)
@param thd the current thread handle
@param db_name name of db of the table to look for
@param db_name name of db of the table to look for
@return first found table, NULL or ERROR_TABLE
*/
TABLE_LIST *SELECT_LEX::find_table(THD *thd,
const LEX_CSTRING *db_name,
const LEX_CSTRING *table_name)
{
uchar buff[STACK_BUFF_ALLOC]; // Max argument in function
if (check_stack_overrun(thd, STACK_MIN_SIZE, buff))
return NULL;
List_iterator_fast <TABLE_LIST> ti(leaf_tables);
TABLE_LIST *table;
while ((table= ti++))
{
if (cmp(&table->db, db_name) == 0 &&
cmp(&table->table_name, table_name) == 0)
return table;
}
for (SELECT_LEX_UNIT *u= first_inner_unit(); u; u= u->next_unit())
{
for (st_select_lex *sl= u->first_select(); sl; sl=sl->next_select())
{
if ((table= sl->find_table(thd, db_name, table_name)))
return table;
}
}
return NULL;
}
bool st_select_lex::is_query_topmost(THD *thd)
{