diff options
author | Galina Shalygina <galina.shalygina@mariadb.com> | 2018-06-01 21:57:10 +0200 |
---|---|---|
committer | Galina Shalygina <galina.shalygina@mariadb.com> | 2018-06-01 21:57:10 +0200 |
commit | 6db465d7ce455cf75ec224108cbe61ca8be63d3d (patch) | |
tree | 9648ff1fc677eebb60b278c2e2c13131934ed2a0 /sql/sql_derived.cc | |
parent | ffe83e8e7bef32eb2a80aad2d382f0b023dd3a44 (diff) | |
parent | 4a49f7f88cfa82ae6eb8e7b5a528e91416b33b52 (diff) | |
download | mariadb-git-shagalla-10.4.tar.gz |
Merge 10.3.7 into 10.4shagalla-10.4
Diffstat (limited to 'sql/sql_derived.cc')
-rw-r--r-- | sql/sql_derived.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 2df740b6811..944fc837572 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -674,7 +674,8 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived) table reference from a subquery for this. */ DBUG_ASSERT(derived->with->get_sq_rec_ref()); - if (mysql_derived_prepare(lex->thd, lex, derived->with->get_sq_rec_ref())) + if (unlikely(mysql_derived_prepare(lex->thd, lex, + derived->with->get_sq_rec_ref()))) DBUG_RETURN(TRUE); } @@ -698,7 +699,7 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived) &derived->alias, FALSE, FALSE, FALSE, 0); thd->create_tmp_table_for_derived= FALSE; - if (!res && !derived->table) + if (likely(!res) && !derived->table) { derived->derived_result->set_unit(unit); derived->table= derived->derived_result->table; @@ -747,8 +748,6 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived) } } - unit->derived= derived; - /* Above cascade call of prepare is important for PS protocol, but after it is called we can check if we really need prepare for this derived @@ -766,7 +765,7 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived) lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_DERIVED; // st_select_lex_unit::prepare correctly work for single select - if ((res= unit->prepare(thd, derived->derived_result, 0))) + if ((res= unit->prepare(derived, derived->derived_result, 0))) goto exit; if (derived->with && (res= derived->with->rename_columns_of_derived_unit(thd, unit))) |