summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2003-09-02 19:56:55 +0300
committerunknown <bell@sanja.is.com.ua>2003-09-02 19:56:55 +0300
commit2d7b48987621f20a57487d460d3bd77be4f254d5 (patch)
tree354683527bb4727d44f35e20a3d4f06e5e53d9b3 /sql/item_cmpfunc.cc
parent0e2f62640500d2d8c0acfbcdc91f207b8457da48 (diff)
downloadmariadb-git-2d7b48987621f20a57487d460d3bd77be4f254d5.tar.gz
fixed BUG#1180 (changing WHERE clause of prepared statements by optimisation)
sql/item.h: constructor and method for aloning AND/OR structure of WHERE clause sql/item_cmpfunc.cc: constructor and method for aloning AND/OR structure of WHERE clause sql/item_cmpfunc.h: constructor and method for aloning AND/OR structure of WHERE clause sql/item_func.cc: constructor for aloning AND/OR structure of WHERE clause sql/item_func.h: constructor for aloning AND/OR structure of WHERE clause sql/sql_lex.cc: field for saving WHERE root sql/sql_lex.h: field for saving WHERE root sql/sql_prepare.cc: saving WHERE root creating new AND/OR structure before executing prepared statement tests/client_test.c: test suite for bug #1180
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 3471ddd30e9..7460c103550 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1549,6 +1549,31 @@ longlong Item_func_bit_and::val_int()
return (longlong) (arg1 & arg2);
}
+Item_cond::Item_cond(THD *thd, Item_cond &item)
+ :Item_bool_func(thd, item),
+ abort_on_null(item.abort_on_null),
+ and_tables_cache(item.and_tables_cache)
+{
+ /*
+ here should be following text:
+
+ List_iterator_fast<Item*> li(item.list);
+ while(Item *it= li++)
+ list.push_back(it);
+
+ but it do not need,
+ because this constructor used only for AND/OR and
+ argument list will be copied by copy_andor_arguments call
+ */
+
+}
+
+void Item_cond::copy_andor_arguments(THD *thd, Item_cond *item)
+{
+ List_iterator_fast<Item> li(item->list);
+ while(Item *it= li++)
+ list.push_back(it->copy_andor_structure(thd));
+}
bool
Item_cond::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)