summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <timour@mysql.com>2005-08-24 10:52:30 +0300
committerunknown <timour@mysql.com>2005-08-24 10:52:30 +0300
commit660ca01a133f8144a5844fcd208030c46f2f68ee (patch)
tree521afb5ba4515d29cc976d2242d172ec04153c52
parent1c35bcb6aef55db72479b10146cdef00c516bf57 (diff)
parent2f044d3d93a5c87032a39402c35abe460c6773f4 (diff)
downloadmariadb-git-660ca01a133f8144a5844fcd208030c46f2f68ee.tar.gz
Merge mysql.com:/home/timka/mysql/src/5.0-virgin
into mysql.com:/home/timka/mysql/src/5.0-2486
-rw-r--r--sql/sql_base.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index a7f5fa3ce03..b2ed392d1ac 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -3763,8 +3763,13 @@ store_top_level_join_columns(THD *thd, TABLE_LIST *table_ref,
TABLE_LIST *left_neighbor,
TABLE_LIST *right_neighbor)
{
+ Query_arena *arena, backup;
+ bool result= TRUE;
+
DBUG_ENTER("store_top_level_join_columns");
+ arena= thd->change_arena_if_needed(&backup);
+
/* Call the procedure recursively for each nested table reference. */
if (table_ref->nested_join)
{
@@ -3797,7 +3802,7 @@ store_top_level_join_columns(THD *thd, TABLE_LIST *table_ref,
if (cur_table_ref->nested_join &&
store_top_level_join_columns(thd, cur_table_ref,
cur_left_neighbor, cur_right_neighbor))
- DBUG_RETURN(TRUE);
+ goto err;
cur_right_neighbor= cur_table_ref;
}
}
@@ -3829,7 +3834,7 @@ store_top_level_join_columns(THD *thd, TABLE_LIST *table_ref,
swap_variables(TABLE_LIST*, table_ref_1, table_ref_2);
if (mark_common_columns(thd, table_ref_1, table_ref_2,
using_fields, &found_using_fields))
- DBUG_RETURN(TRUE);
+ goto err;
/*
Swap the join operands back, so that we pick the columns of the second
@@ -3841,7 +3846,7 @@ store_top_level_join_columns(THD *thd, TABLE_LIST *table_ref,
if (store_natural_using_join_columns(thd, table_ref, table_ref_1,
table_ref_2, using_fields,
found_using_fields))
- DBUG_RETURN(TRUE);
+ goto err;
/*
Change NATURAL JOIN to JOIN ... ON. We do this for both operands
@@ -3872,7 +3877,12 @@ store_top_level_join_columns(THD *thd, TABLE_LIST *table_ref,
else
table_ref->next_name_resolution_table= NULL;
}
- DBUG_RETURN(FALSE);
+ result= FALSE; /* All is OK. */
+
+err:
+ if (arena)
+ thd->restore_backup_item_arena(arena, &backup);
+ DBUG_RETURN(result);
}