MySQL Forums
Forum List  »  Optimizer & Parser

Re: Source code question related to sql_optimizer.cc line 8583
Posted by: Øystein Grøvlen
Date: November 28, 2017 07:01AM

Hi,

IIUC, your are suggesting this change:

--- a/sql/sql_optimizer.cc
+++ b/sql/sql_optimizer.cc
@@ -8912,7 +8912,7 @@ bool JOIN::attach_join_conditions(plan_idx last_tab)
DBUG_RETURN(true);

// Add the guard turning the predicate off for the null-complemented row.
- cond= new Item_func_trig_cond(cond, NULL, this, first_inner,
+ cond= new Item_func_trig_cond(cond, NULL, this, i,
Item_func_trig_cond::IS_NOT_NULL_COMPL);
if (!cond)
DBUG_RETURN(true);

Running the test suite with this change leads to multiple seg faults; an indication that the change is not correct.

AFAIU, first_inner is used because you are supposed to pass the index for the first table of the join nest. This code in Item_func_trig_cond::get_table_range() indicates that:

JOIN_TAB *join_tab= m_join->best_ref[m_idx];
*first_table= join_tab->table_ref;
last_inner= join_tab->last_inner();
*last_table= m_join->best_ref[last_inner]->table_ref;

m_idx is here the value we are discussing.

Øystein Grøvlen,
Senior Principal Software Engineer,
MySQL Group, Oracle,
Trondheim, Norway

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Source code question related to sql_optimizer.cc line 8583
136
November 28, 2017 07:01AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.