mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Mistakes corrected. Now all tests in opt_tvc.test file work correctly
This commit is contained in:
@ -13633,9 +13633,8 @@ static int compare_fields_by_table_order(Item *field1,
|
||||
static TABLE_LIST* embedding_sjm(Item *item)
|
||||
{
|
||||
Item_field *item_field= (Item_field *) (item->real_item());
|
||||
TABLE_LIST *tbl= item_field->field->table->pos_in_table_list;
|
||||
TABLE_LIST *nest= tbl->embedding;
|
||||
if (nest && nest->sj_mat_info && nest->sj_mat_info->is_used && !tbl->is_for_tvc)
|
||||
TABLE_LIST *nest= item_field->field->table->pos_in_table_list->embedding;
|
||||
if (nest && nest->sj_mat_info && nest->sj_mat_info->is_used)
|
||||
return nest;
|
||||
else
|
||||
return NULL;
|
||||
@ -13712,7 +13711,6 @@ Item *eliminate_item_equal(THD *thd, COND *cond, COND_EQUAL *upper_levels,
|
||||
Item *head;
|
||||
TABLE_LIST *current_sjm= NULL;
|
||||
Item *current_sjm_head= NULL;
|
||||
bool force_producing_equality= false;
|
||||
|
||||
DBUG_ASSERT(!cond ||
|
||||
cond->type() == Item::INT_ITEM ||
|
||||
@ -13734,8 +13732,6 @@ Item *eliminate_item_equal(THD *thd, COND *cond, COND_EQUAL *upper_levels,
|
||||
TABLE_LIST *emb_nest;
|
||||
head= item_equal->get_first(NO_PARTICULAR_TAB, NULL);
|
||||
it++;
|
||||
if (((Item_field *)(head->real_item()))->field->table->pos_in_table_list->is_for_tvc)
|
||||
force_producing_equality= true;
|
||||
if ((emb_nest= embedding_sjm(head)))
|
||||
{
|
||||
current_sjm= emb_nest;
|
||||
@ -13803,7 +13799,7 @@ Item *eliminate_item_equal(THD *thd, COND *cond, COND_EQUAL *upper_levels,
|
||||
produce_equality= FALSE;
|
||||
}
|
||||
|
||||
if (produce_equality || force_producing_equality)
|
||||
if (produce_equality)
|
||||
{
|
||||
if (eq_item && eq_list.push_back(eq_item, thd->mem_root))
|
||||
return 0;
|
||||
@ -13818,8 +13814,7 @@ Item *eliminate_item_equal(THD *thd, COND *cond, COND_EQUAL *upper_levels,
|
||||
equals on top level, or the constant.
|
||||
*/
|
||||
Item *head_item= (!item_const && current_sjm &&
|
||||
current_sjm_head != field_item &&
|
||||
!force_producing_equality) ? current_sjm_head: head;
|
||||
current_sjm_head != field_item) ? current_sjm_head: head;
|
||||
Item *head_real_item= head_item->real_item();
|
||||
if (head_real_item->type() == Item::FIELD_ITEM)
|
||||
head_item= head_real_item;
|
||||
|
Reference in New Issue
Block a user