summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorSinisa@sinisa.nasamreza.org <>2002-10-16 22:27:47 +0300
committerSinisa@sinisa.nasamreza.org <>2002-10-16 22:27:47 +0300
commit0a242026a87a7bf271716fe281faff05d15805ad (patch)
treefc2416590dbbeb05b27ffaf9e8c56d0df14016ae /sql/sql_union.cc
parent6561faa10e8dbc24eedb1d8574053f5f23790ca8 (diff)
downloadmariadb-git-0a242026a87a7bf271716fe281faff05d15805ad.tar.gz
fix of the small bug in UNION's
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 01b0eb9e6ec..eaeec2c1e68 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -109,7 +109,7 @@ int st_select_lex_unit::prepare(THD *thd, select_result *result)
if (prepared)
DBUG_RETURN(0);
prepared= 1;
-
+ union_result=0;
describe=(first_select()->options & SELECT_DESCRIBE) ? 1 : 0;
res= 0;
found_rows_for_union= false;
@@ -309,10 +309,12 @@ int st_select_lex_unit::exec()
int st_select_lex_unit::cleanup()
{
DBUG_ENTER("st_select_lex_unit::cleanup");
- delete union_result;
- free_tmp_table(thd,table);
- table= 0; // Safety
-
+ if (union_result)
+ {
+ delete union_result;
+ free_tmp_table(thd,table);
+ table= 0; // Safety
+ }
List_iterator<JOIN*> j(joins);
JOIN** join;
while ((join= j++))