summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authormonty@mysql.com <>2004-03-25 22:11:22 +0200
committermonty@mysql.com <>2004-03-25 22:11:22 +0200
commit1448199bd75009ac9b4aa42c9d4fb8d827a4cb12 (patch)
tree36abf1d40f08cd21cd81f6d5966b89ab4e995ac6 /sql/sql_union.cc
parenteb91f7b478938969b4a182aed5d624c2f8fce38a (diff)
downloadmariadb-git-1448199bd75009ac9b4aa42c9d4fb8d827a4cb12.tar.gz
Cleanups & safety fixes
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 3a27e606cff..1f35c6b6f3d 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -150,6 +150,9 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
JOIN *join= new JOIN(thd_arg, sl->item_list,
sl->options | thd_arg->options | additional_options,
tmp_result);
+ if (!join)
+ goto err;
+
thd_arg->lex->current_select= sl;
offset_limit_cnt= sl->offset_limit;
select_limit_cnt= sl->select_limit+sl->offset_limit;
@@ -178,6 +181,7 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
Item *item_tmp;
while ((item_tmp= it++))
{
+ /* Error's in 'new' will be detected after loop */
types.push_back(new Item_type_holder(thd_arg, item_tmp));
}
@@ -384,7 +388,10 @@ int st_select_lex_unit::exec()
allocate JOIN for fake select only once (privent
mysql_select automatic allocation)
*/
- fake_select_lex->join= new JOIN(thd, item_list, thd->options, result);
+ if (!(fake_select_lex->join= new JOIN(thd, item_list, thd->options,
+ result)))
+ DBUG_RETURN(-1);
+
/*
Fake st_select_lex should have item list for correctref_array
allocation.