summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-03-17 14:26:26 +0200
committerunknown <bell@sanja.is.com.ua>2004-03-17 14:26:26 +0200
commitf83cf4144065c12cad4007767e2e70d444fd0e05 (patch)
tree879e13469f1915539666e702fc32401e7f3a61d2 /sql/item_cmpfunc.h
parent8242d1f19dcc00a8ad393485f19a1b3d806b8100 (diff)
downloadmariadb-git-f83cf4144065c12cad4007767e2e70d444fd0e05.tar.gz
DBUG_ASSERT(fixed == 0) added to fix_fields()
sql/item.cc: layout fixed fixed bug in prepared statements with subqueries and outer references sql/item.h: neg_transformer get thd argument to call fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 0) added to fix_fields() fixed Item_in_optimizer fixed flag neg_arguments(), neg_transformer() call fix_field() on created items to avoid bouble fix field or non-called fixfields() sql/item_cmpfunc.h: neg_transformer get thd argument to call fix_fields fixed forgoten cleanup() call of parent class sql/item_func.cc: DBUG_ASSERT(fixed == 0) and fixed flag check added to fix_fields() sql/item_func.h: DBUG_ASSERT(fixed == 0) added to fix_fields() fixed forgoten cleanup() call of parent class sql/item_row.cc: DBUG_ASSERT(fixed == 0) added to fix_fields() added forgoten 'fixed' flag set sql/item_subselect.cc: DBUG_ASSERT(fixed == 0) added to fix_fields() fixed subquery transformation sql/sql_base.cc: check of fixed flag added sql/sql_derived.cc: fixed cleunup union in derived table during EXPLAIN command processing sql/sql_select.cc: thd argument add to function to allow call fix_fields() of new created items fixed EXPLAIN double preparation check of fixed flag added eliminate_not_funcs fixed for corrcet fix_fields call of new created items sql/sql_select.h: thd argument add to function to allow call fix_fields() of new created items sql/sql_union.cc: union processing fixed tests/client_test.c: layout fixed new test of outer references fron subqueries
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h29
1 files changed, 17 insertions, 12 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 9d39ddf4e76..463bb215da4 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -218,6 +218,8 @@ public:
tmp_arg[1]= orig_b;
DBUG_VOID_RETURN;
}
+ Item *neg_transformer(THD *thd);
+ virtual Item *negated_item();
};
class Item_func_not :public Item_bool_func
@@ -227,7 +229,7 @@ public:
longlong val_int();
enum Functype functype() const { return NOT_FUNC; }
const char *func_name() const { return "not"; }
- Item *neg_transformer();
+ Item *neg_transformer(THD *thd);
};
class Item_func_not_all :public Item_func_not
@@ -254,7 +256,7 @@ public:
enum Functype rev_functype() const { return EQ_FUNC; }
cond_result eq_cmp_result() const { return COND_TRUE; }
const char *func_name() const { return "="; }
- Item *neg_transformer();
+ Item *negated_item();
};
class Item_func_equal :public Item_bool_rowready_func2
@@ -267,6 +269,7 @@ public:
enum Functype rev_functype() const { return EQUAL_FUNC; }
cond_result eq_cmp_result() const { return COND_TRUE; }
const char *func_name() const { return "<=>"; }
+ Item* neg_transformer(THD *thd) { return 0; }
};
@@ -279,7 +282,7 @@ public:
enum Functype rev_functype() const { return LE_FUNC; }
cond_result eq_cmp_result() const { return COND_TRUE; }
const char *func_name() const { return ">="; }
- Item *neg_transformer();
+ Item *negated_item();
};
@@ -292,7 +295,7 @@ public:
enum Functype rev_functype() const { return LT_FUNC; }
cond_result eq_cmp_result() const { return COND_FALSE; }
const char *func_name() const { return ">"; }
- Item *neg_transformer();
+ Item *negated_item();
};
@@ -305,7 +308,7 @@ public:
enum Functype rev_functype() const { return GE_FUNC; }
cond_result eq_cmp_result() const { return COND_TRUE; }
const char *func_name() const { return "<="; }
- Item *neg_transformer();
+ Item *negated_item();
};
@@ -318,7 +321,7 @@ public:
enum Functype rev_functype() const { return GT_FUNC; }
cond_result eq_cmp_result() const { return COND_FALSE; }
const char *func_name() const { return "<"; }
- Item *neg_transformer();
+ Item *negated_item();
};
@@ -331,7 +334,7 @@ public:
cond_result eq_cmp_result() const { return COND_FALSE; }
optimize_type select_optimize() const { return OPTIMIZE_KEY; }
const char *func_name() const { return "<>"; }
- Item *neg_transformer();
+ Item *negated_item();
};
@@ -409,6 +412,7 @@ public:
enum Item_result result_type () const { return cached_result_type; }
bool fix_fields(THD *thd,struct st_table_list *tlist, Item **ref)
{
+ DBUG_ASSERT(fixed == 0);
args[0]->top_level_item();
return Item_func::fix_fields(thd, tlist, ref);
}
@@ -726,6 +730,7 @@ class Item_func_in :public Item_int_func
void cleanup()
{
DBUG_ENTER("Item_func_in::cleanup");
+ Item_int_func::cleanup();
delete array;
delete in_item;
array= 0;
@@ -778,7 +783,7 @@ public:
}
table_map not_null_tables() const { return 0; }
optimize_type select_optimize() const { return OPTIMIZE_NULL; }
- Item *neg_transformer();
+ Item *neg_transformer(THD *thd);
CHARSET_INFO *compare_collation() { return args[0]->collation.collation; }
};
@@ -812,7 +817,7 @@ public:
const char *func_name() const { return "isnotnull"; }
optimize_type select_optimize() const { return OPTIMIZE_NULL; }
table_map not_null_tables() const { return 0; }
- Item *neg_transformer();
+ Item *neg_transformer(THD *thd);
void print(String *str);
CHARSET_INFO *compare_collation() { return args[0]->collation.collation; }
};
@@ -920,7 +925,7 @@ public:
void top_level_item() { abort_on_null=1; }
void copy_andor_arguments(THD *thd, Item_cond *item);
bool walk(Item_processor processor, byte *arg);
- void neg_arguments();
+ void neg_arguments(THD *thd);
};
@@ -941,7 +946,7 @@ public:
item->copy_andor_arguments(thd, this);
return item;
}
- Item *neg_transformer();
+ Item *neg_transformer(THD *thd);
};
class Item_cond_or :public Item_cond
@@ -962,7 +967,7 @@ public:
item->copy_andor_arguments(thd, this);
return item;
}
- Item *neg_transformer();
+ Item *neg_transformer(THD *thd);
};