summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2002-07-01 19:06:24 +0300
committerunknown <bell@sanja.is.com.ua>2002-07-01 19:06:24 +0300
commit5d2927e4a67dfc181cb4cae9fe74888676d83491 (patch)
tree9bbf4c725f328497c27f5140a8214792abf6c79f
parentfd8c7586929e682c0e264e3b229f6875d30065ad (diff)
downloadmariadb-git-5d2927e4a67dfc181cb4cae9fe74888676d83491.tar.gz
subselect clean up
fix after automerge sql/item_strfunc.cc: fix after automerge sql/sql_lex.h: subselect clean up sql/sql_select.cc: subselect clean up
-rw-r--r--sql/item_strfunc.cc2
-rw-r--r--sql/sql_lex.h4
-rw-r--r--sql/sql_select.cc16
3 files changed, 20 insertions, 2 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 5bb2c4015ad..1aee4e7d553 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1922,7 +1922,7 @@ bool Item_func_conv_charset::fix_fields(THD *thd,struct st_table_list *tables)
if (thd && check_stack_overrun(thd,buff))
return 0; // Fatal error if flag is set!
- if (args[0]->fix_fields(thd,tables))
+ if (args[0]->fix_fields(thd, tables, args))
return 1;
maybe_null=args[0]->maybe_null;
binary=args[0]->binary;
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index c3a4526e052..658c1dc2cdb 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -240,6 +240,7 @@ typedef struct st_select_lex_unit SELECT_LEX_UNIT;
/*
SELECT_LEX - store information of parsed SELECT_LEX statment
*/
+class JOIN;
class st_select_lex: public st_select_lex_node {
public:
char *db, *db1, *table1, *db2, *table2; /* For outer join using .. */
@@ -251,12 +252,13 @@ public:
List<String> interval_list, use_index, *use_index_ptr,
ignore_index, *ignore_index_ptr;
List<Item_func_match> ftfunc_list;
+ JOIN *join; /* after JOIN::prepare it is pointer to corresponding JOIN */
uint in_sum_expr;
bool create_refs,
braces, /* SELECT ... UNION (SELECT ... ) <- this braces */
depended, /* depended from outer select subselect */
/* TRUE when having fix field called in processing of this SELECT */
- having_fix_field;
+ having_fix_field;e
void init_query();
void init_select();
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 8dd611add86..76f78009e84 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -211,6 +211,7 @@ JOIN::prepare(TABLE_LIST *tables_init,
proc_param= proc_param_init;
tables_list= tables_init;
select_lex= select;
+ select->join= this;
union_part= (unit->first_select()->next_select() != 0);
/* Check that all tables, fields, conds and order are ok */
@@ -974,6 +975,21 @@ JOIN::cleanup(THD *thd)
delete select;
delete_dynamic(&keyuse);
delete procedure;
+ for (SELECT_LEX_UNIT *unit= select_lex->first_inner_unit();
+ unit != 0;
+ unit= unit->next_unit())
+ for (SELECT_LEX *sl= unit->first_select();
+ sl != 0;
+ sl= sl->next_select())
+ {
+ if (sl->join)
+ {
+ int err= sl->join->cleanup(thd);
+ if (err)
+ error= err;
+ sl->join= 0;
+ }
+ }
return error;
}