diff options
author | unknown <evgen@moonbone.local> | 2007-04-15 08:41:35 +0400 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2007-04-15 08:41:35 +0400 |
commit | 9255aab5bf69c6d10005602838b28ab77c270303 (patch) | |
tree | 8d98f51529a98d13226c37e34586d22522f046ae /sql/item.h | |
parent | ccdf807f3b2cb5a923db5a1de714db2a04264d35 (diff) | |
parent | 1cf3b96513db0ca2a0e217e2be512cdcaa04c82e (diff) | |
download | mariadb-git-9255aab5bf69c6d10005602838b28ab77c270303.tar.gz |
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into moonbone.local:/mnt/gentoo64/work/27321-bug-5.0-opt-mysql
mysql-test/r/subselect3.result:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/sql_select.cc:
Auto merged
mysql-test/r/subselect.result:
Manually merged
mysql-test/t/subselect.test:
Manually merged
mysql-test/t/subselect3.test:
Manually merged
Diffstat (limited to 'sql/item.h')
-rw-r--r-- | sql/item.h | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/sql/item.h b/sql/item.h index 2c4943bea6e..094c45642da 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1220,7 +1220,6 @@ public: uint have_privileges; /* field need any privileges (for VIEW creation) */ bool any_privileges; - bool fixed_as_field; Item_field(Name_resolution_context *context_arg, const char *db_arg,const char *table_name_arg, const char *field_name_arg); @@ -1978,30 +1977,49 @@ public: }; +/* + Class for outer fields. + An object of this class is created when the select where the outer field was + resolved is a grouping one. After it has been fixed the ref field will point + to either an Item_ref or an Item_direct_ref object which will be used to + access the field. + See also comments for the fix_inner_refs() and the + Item_field::fix_outer_field() functions. +*/ + +class Item_sum; class Item_outer_ref :public Item_direct_ref { public: - Item_field *outer_field; + Item *outer_ref; + /* The aggregate function under which this outer ref is used, if any. */ + Item_sum *in_sum_func; + /* + TRUE <=> that the outer_ref is already present in the select list + of the outer select. + */ + bool found_in_select_list; Item_outer_ref(Name_resolution_context *context_arg, Item_field *outer_field_arg) :Item_direct_ref(context_arg, 0, outer_field_arg->table_name, - outer_field_arg->field_name), - outer_field(outer_field_arg) + outer_field_arg->field_name), + outer_ref(outer_field_arg), in_sum_func(0), + found_in_select_list(0) { - ref= (Item**)&outer_field; + ref= &outer_ref; set_properties(); fixed= 0; } - void cleanup() - { - ref= (Item**)&outer_field; - fixed= 0; - Item_direct_ref::cleanup(); - outer_field->cleanup(); - } + Item_outer_ref(Name_resolution_context *context_arg, Item **item, + const char *table_name_arg, const char *field_name_arg, + bool alias_name_used_arg) + :Item_direct_ref(context_arg, item, table_name_arg, field_name_arg, + alias_name_used_arg), + outer_ref(0), in_sum_func(0), found_in_select_list(1) + {} void save_in_result_field(bool no_conversions) { - outer_field->save_org_in_field(result_field); + outer_ref->save_org_in_field(result_field); } bool fix_fields(THD *, Item **); table_map used_tables() const |