summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2002-11-14 00:26:18 +0200
committerbell@sanja.is.com.ua <>2002-11-14 00:26:18 +0200
commit41d9311621914c61382b1733c714a423f618ba8e (patch)
treed888a4517004a1a442146f5d6b8c8ca5fa2515dc /sql/item_cmpfunc.cc
parent9ef972fd2cb8e0b147ebc8068299a32f4ea528b6 (diff)
downloadmariadb-git-41d9311621914c61382b1733c714a423f618ba8e.tar.gz
fixed cyclic reference bug
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index b6ea4beb339..744ed1bceca 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -344,6 +344,14 @@ void Item_func_interval::update_used_tables()
const_item_cache&=item->const_item();
}
+bool Item_func_interval::check_loop(uint id)
+{
+ DBUG_ENTER("Item_func_interval::check_loop");
+ if (Item_func::check_loop(id))
+ DBUG_RETURN(1);
+ DBUG_RETURN(item->check_loop(id));
+}
+
void Item_func_between::fix_length_and_dec()
{
max_length=1;
@@ -776,6 +784,16 @@ Item_func_case::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
return 0;
}
+bool Item_func_case::check_loop(uint id)
+{
+ DBUG_ENTER("Item_func_case::check_loop");
+ if (Item_func::check_loop(id))
+ DBUG_RETURN(1);
+
+ DBUG_RETURN((first_expr && first_expr->check_loop(id)) ||
+ (else_expr && else_expr->check_loop(id)));
+}
+
void Item_func_case::update_used_tables()
{
Item_func::update_used_tables();
@@ -1137,6 +1155,20 @@ Item_cond::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
return 0;
}
+bool Item_cond::check_loop(uint id)
+{
+ DBUG_ENTER("Item_cond::check_loop");
+ if (Item_func::check_loop(id))
+ DBUG_RETURN(1);
+ List_iterator<Item> li(list);
+ Item *item;
+ while ((item= li++))
+ {
+ if (item->check_loop(id))
+ DBUG_RETURN(1);
+ }
+ DBUG_RETURN(0);
+}
void Item_cond::split_sum_func(List<Item> &fields)
{