From 321ff25f3d419bc1a1fae2390450d1b4db30b64c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Mar 2014 13:57:07 +0200 Subject: MDEV-5740: Assertion `!derived->first_select()->exclude_from_table_unique_test || derived->outer_select()-> exclude_from_table_unique_test' failed on 2nd execution of PS with derived_merge Do not check tables of executed units. Debug info about stages of derived tables execution added. --- sql/sql_base.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'sql/sql_base.cc') diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 4e8847d1fe0..9d3a59afa0b 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1735,6 +1735,17 @@ retry: DBUG_PRINT("info", ("real table: %s.%s", d_name, t_name)); for (TABLE_LIST *tl= table_list;;) { + if (tl && + tl->select_lex && tl->select_lex->master_unit() && + tl->select_lex->master_unit()->executed) + { + /* + There is no sense to check tables of already executed parts + of the query + */ + tl= tl->next_global; + continue; + } if (((! (res= find_table_in_global_list(tl, d_name, t_name))) && (! (res= mysql_lock_have_duplicate(thd, table, tl)))) || ((!res->table || res->table != table->table) && -- cgit v1.2.1