MCPcopy Create free account
hub / github.com/MariaDB/server / evaluate_join_record

Function evaluate_join_record

sql/sql_select.cc:24792–24989  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24790*/
24791
24792static enum_nested_loop_state
24793evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
24794 int error)
24795{
24796 bool shortcut_for_distinct= join_tab->shortcut_for_distinct;
24797 ha_rows found_records=join->found_records;
24798 COND *select_cond= join_tab->select_cond;
24799 bool select_cond_result= TRUE;
24800 DBUG_ENTER("evaluate_join_record");
24801 DBUG_PRINT("enter",
24802 ("evaluate_join_record join: %p join_tab: %p "
24803 "cond: %p abort: %d alias %s",
24804 join, join_tab, select_cond, error,
24805 join_tab->table->alias.ptr()));
24806
24807 if (error > 0 || unlikely(join->thd->is_error())) // Fatal error
24808 DBUG_RETURN(NESTED_LOOP_ERROR);
24809 if (error < 0)
24810 DBUG_RETURN(NESTED_LOOP_NO_MORE_ROWS);
24811 if (unlikely(join->thd->check_killed())) // Aborted by user
24812 {
24813 DBUG_RETURN(NESTED_LOOP_KILLED); /* purecov: inspected */
24814 }
24815
24816 join_tab->tracker->r_rows++;
24817
24818 if (select_cond)
24819 {
24820 select_cond_result= MY_TEST(select_cond->val_bool());
24821
24822 /* check for errors evaluating the condition */
24823 if (unlikely(join->thd->is_error()))
24824 DBUG_RETURN(NESTED_LOOP_ERROR);
24825 }
24826
24827 if (select_cond_result)
24828 {
24829 /*
24830 There is no select condition or the attached pushed down
24831 condition is true => a match is found.
24832 */
24833 join_tab->tracker->r_rows_after_where++;
24834
24835 bool found= 1;
24836 while (join_tab->first_unmatched && found)
24837 {
24838 /*
24839 The while condition is always false if join_tab is not
24840 the last inner join table of an outer join operation.
24841 */
24842 JOIN_TAB *first_unmatched= join_tab->first_unmatched;
24843 /*
24844 Mark that a match for current outer table is found.
24845 This activates push down conditional predicates attached
24846 to the all inner tables of the outer join.
24847 */
24848 first_unmatched->found= 1;
24849 for (JOIN_TAB *tab= first_unmatched; tab <= join_tab; tab++)

Callers 2

sub_selectFunction · 0.85
end_sendMethod · 0.85

Calls 9

check_killedMethod · 0.80
sj_weedout_check_rowMethod · 0.80
get_stmt_daMethod · 0.80
ptrMethod · 0.45
is_errorMethod · 0.45
val_boolMethod · 0.45
unlock_rowMethod · 0.45

Tested by

no test coverage detected