Commit b70cb552 authored by Sergey Petrunya's avatar Sergey Petrunya

MWL#17: Table elimination

- code cleanup
parent 8c009306
...@@ -125,7 +125,7 @@ public: ...@@ -125,7 +125,7 @@ public:
make elements that depend on them bound, too. make elements that depend on them bound, too.
*/ */
Module_dep *next; Module_dep *next;
uint unknown_args; /* TRUE<=> The entity is considered bound */ uint unknown_args;
Module_dep() : next(NULL), unknown_args(0) {} Module_dep() : next(NULL), unknown_args(0) {}
}; };
...@@ -249,11 +249,9 @@ void run_elimination_wave(Table_elimination *te, Module_dep *bound_modules); ...@@ -249,11 +249,9 @@ void run_elimination_wave(Table_elimination *te, Module_dep *bound_modules);
void eliminate_tables(JOIN *join); void eliminate_tables(JOIN *join);
static void mark_as_eliminated(JOIN *join, TABLE_LIST *tbl); static void mark_as_eliminated(JOIN *join, TABLE_LIST *tbl);
#if 0
#ifndef DBUG_OFF #ifndef DBUG_OFF
static void dbug_print_deps(Table_elimination *te); static void dbug_print_deps(Table_elimination *te);
#endif #endif
#endif
/*******************************************************************************************/ /*******************************************************************************************/
/* /*
...@@ -854,7 +852,7 @@ collect_funcdeps_for_join_list(Table_elimination *te, ...@@ -854,7 +852,7 @@ collect_funcdeps_for_join_list(Table_elimination *te,
/* /*
This is used to analyse expressions in "tbl.col=expr" dependencies so This is used to analyze expressions in "tbl.col=expr" dependencies so
that we can figure out which fields the expression depends on. that we can figure out which fields the expression depends on.
*/ */
...@@ -965,7 +963,7 @@ bool setup_equality_deps(Table_elimination *te, Module_dep **bound_deps_list) ...@@ -965,7 +963,7 @@ bool setup_equality_deps(Table_elimination *te, Module_dep **bound_deps_list)
} }
*bound_deps_list= bound_dep; *bound_deps_list= bound_dep;
//DBUG_EXECUTE("test", dbug_print_deps(te); ); DBUG_EXECUTE("test", dbug_print_deps(te); );
DBUG_RETURN(FALSE); DBUG_RETURN(FALSE);
} }
...@@ -1089,7 +1087,6 @@ static ...@@ -1089,7 +1087,6 @@ static
void signal_from_field_to_exprs(Table_elimination* te, Field_value *field_dep, void signal_from_field_to_exprs(Table_elimination* te, Field_value *field_dep,
Module_dep **bound_modules) Module_dep **bound_modules)
{ {
/* Now, expressions */
for (uint i=0; i < te->n_equality_deps; i++) for (uint i=0; i < te->n_equality_deps; i++)
{ {
if (bitmap_is_set(&te->expr_deps, field_dep->bitmap_offset + i) && if (bitmap_is_set(&te->expr_deps, field_dep->bitmap_offset + i) &&
...@@ -1213,7 +1210,6 @@ void run_elimination_wave(Table_elimination *te, Module_dep *bound_modules) ...@@ -1213,7 +1210,6 @@ void run_elimination_wave(Table_elimination *te, Module_dep *bound_modules)
for (Outer_join_module *outer_join_dep= table_dep->outer_join_dep; for (Outer_join_module *outer_join_dep= table_dep->outer_join_dep;
outer_join_dep; outer_join_dep= outer_join_dep->parent) outer_join_dep; outer_join_dep= outer_join_dep->parent)
{ {
//if (!(outer_join_dep->missing_tables &= ~table_dep->table->map))
if (outer_join_dep->unknown_args && if (outer_join_dep->unknown_args &&
!--outer_join_dep->unknown_args) !--outer_join_dep->unknown_args)
{ {
...@@ -1268,7 +1264,6 @@ static void mark_as_eliminated(JOIN *join, TABLE_LIST *tbl) ...@@ -1268,7 +1264,6 @@ static void mark_as_eliminated(JOIN *join, TABLE_LIST *tbl)
} }
#if 0
#ifndef DBUG_OFF #ifndef DBUG_OFF
static static
void dbug_print_deps(Table_elimination *te) void dbug_print_deps(Table_elimination *te)
...@@ -1323,7 +1318,6 @@ void dbug_print_deps(Table_elimination *te) ...@@ -1323,7 +1318,6 @@ void dbug_print_deps(Table_elimination *te)
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
#endif
#endif #endif
/** /**
@} (end of group Table_Elimination) @} (end of group Table_Elimination)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment