summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorunknown <timour@mysql.com>2006-04-04 14:35:17 +0300
committerunknown <timour@mysql.com>2006-04-04 14:35:17 +0300
commit7b61256f68bbf7c11cb9ed40fc9814bb86e8069f (patch)
treecb10183b7c926693a43a81d41bf8e91d833c3f14 /sql/item.cc
parent3d34946e762c01157ebe7bae2482ed4bfd3b5e84 (diff)
parent085aa5c99e7935b0895d09acad13685ba2e6c3e4 (diff)
downloadmariadb-git-7b61256f68bbf7c11cb9ed40fc9814bb86e8069f.tar.gz
Merge mysql.com:/home/timka/mysql/src/5.0-tmp-merge
into mysql.com:/home/timka/mysql/src/5.1-merge sql/item.cc: Auto merged sql/item.h: Auto merged sql/opt_range.cc: Auto merged
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc34
1 files changed, 33 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 885617669a9..466216ffb78 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -496,7 +496,7 @@ bool Item_ident::remove_dependence_processor(byte * arg)
arguments in a condition the method must return false.
RETURN
- false to force the evaluation of collect_item_field_processor
+ FALSE to force the evaluation of collect_item_field_processor
for the subsequent items.
*/
@@ -517,6 +517,38 @@ bool Item_field::collect_item_field_processor(byte *arg)
}
+/*
+ Check if an Item_field references some field from a list of fields.
+
+ SYNOPSIS
+ Item_field::find_item_in_field_list_processor
+ arg Field being compared, arg must be of type Field
+
+ DESCRIPTION
+ Check whether the Item_field represented by 'this' references any
+ of the fields in the keyparts passed via 'arg'. Used with the
+ method Item::walk() to test whether any keypart in a sequence of
+ keyparts is referenced in an expression.
+
+ RETURN
+ TRUE if 'this' references the field 'arg'
+ FALE otherwise
+*/
+bool Item_field::find_item_in_field_list_processor(byte *arg)
+{
+ KEY_PART_INFO *first_non_group_part= *((KEY_PART_INFO **) arg);
+ KEY_PART_INFO *last_part= *(((KEY_PART_INFO **) arg) + 1);
+ KEY_PART_INFO *cur_part;
+
+ for (cur_part= first_non_group_part; cur_part != last_part; cur_part++)
+ {
+ if (field->eq(cur_part->field))
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
bool Item::check_cols(uint c)
{
if (c != 1)