summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorunknown <bell@laptop.sanja.is.com.ua>2003-10-06 20:55:06 +0300
committerunknown <bell@laptop.sanja.is.com.ua>2003-10-06 20:55:06 +0300
commitff8c8fa1efc4a622e571381c34c5a4575d0f3b5e (patch)
treef658418875ab7ed1c8c3198dc5135387bf23a7a6 /sql/item.h
parent12b769418af82303239d43447def128ed933b440 (diff)
parent6fc8b48c4652d404b38146844d17ed2a01a3b327 (diff)
downloadmariadb-git-ff8c8fa1efc4a622e571381c34c5a4575d0f3b5e.tar.gz
Merge
mysql-test/r/union.result: Auto merged mysql-test/t/union.test: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_cmpfunc.h: Auto merged sql/item_subselect.cc: Auto merged sql/item_subselect.h: Auto merged sql/item_sum.cc: Auto merged sql/item_sum.h: Auto merged sql/mysql_priv.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_derived.cc: Auto merged sql/sql_union.cc: Auto merged sql/sql_yacc.yy: Auto merged mysql-test/r/subselect.result: SCCS merged mysql-test/t/subselect.test: SCCS merged
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/sql/item.h b/sql/item.h
index 4a1c6ac37b6..a126a61e32e 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003
+/* Copyright (C) 2000-2003 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -120,6 +120,9 @@ public:
Constructor used by Item_field, Item_ref & agregate (sum) functions.
Used for duplicating lists in processing queries with temporary
tables
+ Also it used for Item_cond_and/Item_cond_or for creating
+ top AND/OR ctructure of WHERE clause to protect it of
+ optimisation changes in prepared statements
*/
Item(THD *thd, Item &item);
virtual ~Item() { name=0; } /*lint -e1509 */
@@ -140,7 +143,7 @@ public:
virtual double val()=0;
virtual longlong val_int()=0;
virtual String *val_str(String*)=0;
- virtual Field *tmp_table_field() { return 0; }
+ virtual Field *get_tmp_table_field() { return 0; }
virtual Field *tmp_table_field(TABLE *t_arg) { return 0; }
virtual const char *full_name() const { return name ? name : "???"; }
virtual double val_result() { return val(); }
@@ -184,6 +187,7 @@ public:
virtual void save_in_result_field(bool no_conversions) {}
virtual void no_rows_in_result() {}
virtual Item *copy_or_same(THD *thd) { return this; }
+ virtual Item *copy_andor_structure(THD *thd) { return this; }
virtual Item *real_item() { return this; }
virtual Item *get_tmp_table_item(THD *thd) { return copy_or_same(thd); }
@@ -206,6 +210,8 @@ public:
virtual bool null_inside() { return 0; }
// used in row subselects to get value of elements
virtual void bring_value() {}
+
+ Field *tmp_table_field_from_field_type(TABLE *table);
};
@@ -266,7 +272,7 @@ public:
{
return field->type();
}
- Field *tmp_table_field() { return result_field; }
+ Field *get_tmp_table_field() { return result_field; }
Field *tmp_table_field(TABLE *t_arg) { return result_field; }
bool get_date(TIME *ltime,bool fuzzydate);
bool get_date_result(TIME *ltime,bool fuzzydate);
@@ -341,7 +347,11 @@ public:
void set_time(TIME *tm, timestamp_type type);
bool get_time(TIME *tm);
void reset() {}
+#ifndef EMBEDDED_LIBRARY
void (*setup_param_func)(Item_param *param, uchar **pos);
+#else
+ void (*setup_param_func)(Item_param *param, uchar **pos, ulong data_len);
+#endif
enum Item_result result_type () const
{ return item_result_type; }
String *query_val_str(String *str);
@@ -504,6 +514,7 @@ public:
Item_empty_string(const char *header,uint length) :Item_string("",0,
&my_charset_bin)
{ name=(char*) header; max_length=length;}
+ void make_field(Send_field *field);
};
class Item_return_int :public Item_int
@@ -540,12 +551,12 @@ class Item_result_field :public Item /* Item with result field */
public:
Field *result_field; /* Save result here */
Item_result_field() :result_field(0) {}
- // Constructor used for Item_sum (see Item comment)
+ // Constructor used for Item_sum/Item_cond_and/or (see Item comment)
Item_result_field(THD *thd, Item_result_field &item):
Item(thd, item), result_field(item.result_field)
{}
~Item_result_field() {} /* Required with gcc 2.95 */
- Field *tmp_table_field() { return result_field; }
+ Field *get_tmp_table_field() { return result_field; }
Field *tmp_table_field(TABLE *t_arg) { return result_field; }
table_map used_tables() const { return 1; }
virtual void fix_length_and_dec()=0;
@@ -863,6 +874,7 @@ public:
{
value= item->val_int_result();
null_value= item->null_value;
+ collation.set(item->collation);
}
double val() { return (double) value; }
longlong val_int() { return value; }
@@ -880,6 +892,7 @@ public:
{
value= item->val_result();
null_value= item->null_value;
+ collation.set(item->collation);
}
double val() { return value; }
longlong val_int() { return (longlong) (value+(value > 0 ? 0.5 : -0.5)); }