diff options
author | unknown <timour@mysql.com> | 2006-03-31 12:39:33 +0300 |
---|---|---|
committer | unknown <timour@mysql.com> | 2006-03-31 12:39:33 +0300 |
commit | 085aa5c99e7935b0895d09acad13685ba2e6c3e4 (patch) | |
tree | 88258692d6bed7dc04376eda6523507dc716bcd6 /sql/item.cc | |
parent | 86504f87851d7eb5947d3bba41ae0ddf45aa92ab (diff) | |
parent | a01d48f92e9c2eebe91e92962b5fdb075978c712 (diff) | |
download | mariadb-git-085aa5c99e7935b0895d09acad13685ba2e6c3e4.tar.gz |
Merge mysql.com:/home/timka/mysql/src/5.0-virgin
into mysql.com:/home/timka/mysql/src/5.0-bug-16710
mysql-test/r/group_min_max.result:
Auto merged
mysql-test/t/group_min_max.test:
Auto merged
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.cc | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc index 8ffe7a6b2fd..036812f2f76 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) |