From 014073b0139af46abe06aa7fb80144c9436acf98 Mon Sep 17 00:00:00 2001 From: "Sinisa@sinisa.nasamreza.org" <> Date: Fri, 15 Nov 2002 19:58:07 +0200 Subject: [PATCH] A fix for the bug when MyISAM tmp table has to be created in order to resolve derived table. Will make a test case for this quite soon. --- sql/sql_derived.cc | 3 ++- sql/sql_union.cc | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 7cbc1ea6db3..44183a95473 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -88,6 +88,7 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t) if ((derived_result=new select_union(table))) { + derived_result->tmp_table_param=&tmp_table_param; unit->offset_limit_cnt= sl->offset_limit; unit->select_limit_cnt= sl->select_limit+sl->offset_limit; if (unit->select_limit_cnt < sl->select_limit) @@ -118,7 +119,7 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t) table->tmp_table=TMP_TABLE; if (!lex->describe) sl->exclude(); - t->db=""; + t->db=(char *)""; t->derived=(SELECT_LEX *)0; // just in case ... } } diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 53f89747ce7..f48b879838f 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -80,6 +80,7 @@ bool select_union::send_data(List &values) { if (create_myisam_from_heap(table, tmp_table_param, info.last_errno, 0)) return 1; + thd->net.report_error=0; // donno why does it work, but it does ... } return 0; }