summaryrefslogtreecommitdiff
path: root/sql/sql_derived.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_derived.cc')
-rw-r--r--sql/sql_derived.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index 84622398f6f..ea7545fe5cb 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -176,8 +176,8 @@ exit:
}
orig_table_list->derived_result= derived_result;
orig_table_list->table= table;
- orig_table_list->table_name= (char*) table->s->table_name;
- orig_table_list->table_name_length= strlen((char*)table->s->table_name);
+ orig_table_list->table_name= table->s->table_name.str;
+ orig_table_list->table_name_length= table->s->table_name.length;
table->derived_select_number= first_select->select_number;
table->s->tmp_table= NON_TRANSACTIONAL_TMP_TABLE;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
@@ -236,9 +236,7 @@ bool mysql_derived_filling(THD *thd, LEX *lex, TABLE_LIST *orig_table_list)
SELECT_LEX *first_select= unit->first_select();
select_union *derived_result= orig_table_list->derived_result;
SELECT_LEX *save_current_select= lex->current_select;
- bool is_union= first_select->next_select() &&
- first_select->next_select()->linkage == UNION_TYPE;
- if (is_union)
+ if (unit->is_union())
{
// execute union without clean up
res= unit->exec();