Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(StoneDB 8.0): st_select_lex::set_join is deleted in mysql8.0. (#598) #602

Merged
merged 2 commits into from
Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions sql/sql_lex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4398,23 +4398,13 @@ void Query_block::include_chain_in_global(Query_block **start) {
*start = this;
}

// stonedb8 start TODO: a better way.
//
// follows: from MySQL 5.7.36
//void st_select_lex::set_join(JOIN *join_arg)
//{
// master_unit()->thd->lock_query_plan();
// join= join_arg;
// master_unit()->thd->unlock_query_plan();
//}
//
void Query_block::set_join(JOIN *join_arg)
void Query_block::set_join(THD *thd, JOIN *join_arg)
{
thd->lock_query_plan();
join= join_arg;
thd->unlock_query_plan();
}

// stonedb8 end

/**
Helper function which handles the "ON conditions" part of
Query_block::get_optimizable_conditions().
Expand Down
2 changes: 1 addition & 1 deletion sql/sql_lex.h
Original file line number Diff line number Diff line change
Expand Up @@ -1797,7 +1797,7 @@ class Query_block {
The function sets the pointer only after acquiring THD::LOCK_query_plan
mutex. This is needed to avoid races when EXPLAIN FOR CONNECTION is used.
*/
void set_join(JOIN *join_arg);
void set_join(THD *thd, JOIN *join_arg);

/**
Does permanent transformations which are local to a query block (which do
Expand Down
6 changes: 3 additions & 3 deletions storage/tianmu/core/engine_execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ int optimize_select(THD *thd, ulong select_options, Query_result *result,
}
if (!(join = new JOIN(thd, select_lex)))
return true; /* purecov: inspected */
select_lex->set_join(join); // stonedb8 TODO
select_lex->set_join(thd, join);

}
join->best_rowcount = 2;
Expand Down Expand Up @@ -564,7 +564,7 @@ int Query_expression::optimize_for_tianmu(THD *thd) {
cleanup(thd, 0); // stonedb8
return true;
}
sl->set_join(join);
sl->set_join(thd, join);
}
if (is_optimized())
sl->join->reset();
Expand Down Expand Up @@ -651,7 +651,7 @@ int Query_expression::optimize_after_tianmu(THD *thd)
cleanup(thd, 0); // stonedb8
return true;
}
sl->set_join(join);
sl->set_join(thd, join);
}
int res = sl->join->optimize(2);
if (res) {
Expand Down