summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2009-08-13 02:34:21 +0400
committerSergey Petrunya <psergey@askmonty.org>2009-08-13 02:34:21 +0400
commit854bb82bd81afa6decc436b9ecf6af4954efebe5 (patch)
treefce26373e6bb62ae4ab4f3e1fc922d53145deb8b /sql/item.cc
parent5ecad03df9eef6e4d68cc7767b684944384e084e (diff)
downloadmariadb-git-854bb82bd81afa6decc436b9ecf6af4954efebe5.tar.gz
MWL#17: Table elimination
Address review feedback: - Change from Wave-based approach (a-la const table detection) to building and walking functional dependency graph. - Change from piggy-backing on ref-access code and KEYUSE structures to using our own expression analyzer. sql/item.cc: MWL#17: Table elimination - Move from C-ish Field_processor_info to C++ ish and generic Field_enumerator sql/item.h: MWL#17: Table elimination - Move from C-ish Field_processor_info to C++ ish and generic Field_enumerator sql/sql_bitmap.h: MWL#17: Table elimination - Backport of Table_map_iterator from 6.0
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc26
1 files changed, 2 insertions, 24 deletions
diff --git a/sql/item.cc b/sql/item.cc
index a010b98cd40..9cf369a2670 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1918,30 +1918,8 @@ void Item_field::reset_field(Field *f)
bool Item_field::check_column_usage_processor(uchar *arg)
{
- Field_processor_info* info=(Field_processor_info*)arg;
-
- if (field->table == info->table)
- {
- /* It is not ok to use columns that are not part of the key of interest: */
- if (!(field->part_of_key.is_set(info->keyno)))
- return TRUE;
-
- /* Find which key part we're using and mark it in needed_key_parts */
- KEY *key= &field->table->key_info[info->keyno];
- for (uint part= 0; part < key->key_parts; part++)
- {
- if (field->field_index == key->key_part[part].field->field_index)
- {
- if (part == info->forbidden_part)
- return TRUE;
- info->needed_key_parts |= key_part_map(1) << part;
- break;
- }
- }
- return FALSE;
- }
- else
- info->used_tables |= this->used_tables();
+ Field_enumerator *fe= (Field_enumerator*)arg;
+ fe->see_field(field);
return FALSE;
}