summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2002-07-20 14:51:52 +0300
committerunknown <Sinisa@sinisa.nasamreza.org>2002-07-20 14:51:52 +0300
commit907c668729b279c480f028d795b55b761b3aff33 (patch)
tree59a3e303f4dceb2b56763aee0bf50408cb5c153e /sql/item.h
parent4ce602e619d92c697e4a43f38f582c7fe1a9ad2f (diff)
downloadmariadb-git-907c668729b279c480f028d795b55b761b3aff33.tar.gz
OLAP functionality plus some small bug fixes
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/sql/item.h b/sql/item.h
index 7612246b4b0..d4f2ba412a8 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -82,6 +82,7 @@ public:
virtual bool get_date(TIME *ltime,bool fuzzydate);
virtual bool get_time(TIME *ltime);
virtual bool is_null() { return 0; }
+ virtual unsigned int size_of () =0;
};
@@ -96,6 +97,7 @@ public:
:db_name(db_name_par),table_name(table_name_par),field_name(field_name_par)
{ name = (char*) field_name_par; }
const char *full_name() const;
+ virtual unsigned int size_of () { return sizeof(*this);}
};
class Item_field :public Item_ident
@@ -135,6 +137,7 @@ public:
bool get_date(TIME *ltime,bool fuzzydate);
bool get_time(TIME *ltime);
bool is_null() { return field->is_null(); }
+ virtual unsigned int size_of () { return sizeof(*this);}
};
@@ -156,6 +159,7 @@ public:
bool basic_const_item() const { return 1; }
Item *new_item() { return new Item_null(name); }
bool is_null() { return 1; }
+ virtual unsigned int size_of () { return sizeof(*this);}
};
@@ -185,6 +189,7 @@ public:
bool basic_const_item() const { return 1; }
Item *new_item() { return new Item_int(name,value,max_length); }
void print(String *str);
+ virtual unsigned int size_of () { return sizeof(*this);}
};
@@ -198,6 +203,7 @@ public:
void make_field(Send_field *field);
Item *new_item() { return new Item_uint(name,max_length); }
void print(String *str);
+ virtual unsigned int size_of () { return sizeof(*this);}
};
@@ -228,6 +234,7 @@ public:
void make_field(Send_field *field);
bool basic_const_item() const { return 1; }
Item *new_item() { return new Item_real(name,value,decimals,max_length); }
+ virtual unsigned int size_of () { return sizeof(*this);}
};
@@ -239,6 +246,7 @@ public:
decimals=NOT_FIXED_DEC;
max_length=DBL_DIG+8;
}
+ virtual unsigned int size_of () { return sizeof(*this);}
};
class Item_string :public Item
@@ -272,6 +280,7 @@ public:
String *const_string() { return &str_value; }
inline void append(char *str,uint length) { str_value.append(str,length); }
void print(String *str);
+ virtual unsigned int size_of () { return sizeof(*this);}
};
/* for show tables */
@@ -282,6 +291,7 @@ public:
Item_datetime(const char *item_name): Item_string(item_name,"",0)
{ max_length=19;}
void make_field(Send_field *field);
+ virtual unsigned int size_of () { return sizeof(*this);}
};
class Item_empty_string :public Item_string
@@ -289,6 +299,7 @@ class Item_empty_string :public Item_string
public:
Item_empty_string(const char *header,uint length) :Item_string("",0)
{ name=(char*) header; max_length=length;}
+ virtual unsigned int size_of () { return sizeof(*this);}
};
class Item_varbinary :public Item
@@ -303,6 +314,7 @@ public:
bool save_in_field(Field *field);
void make_field(Send_field *field);
enum Item_result result_type () const { return INT_RESULT; }
+ virtual unsigned int size_of () { return sizeof(*this);}
};
@@ -315,6 +327,7 @@ public:
Field *tmp_table_field(TABLE *t_arg=(TABLE *)0) { return result_field; }
table_map used_tables() const { return 1; }
virtual void fix_length_and_dec()=0;
+ virtual unsigned int size_of () { return sizeof(*this);}
};
@@ -364,6 +377,7 @@ public:
void save_org_in_field(Field *field) { (*ref)->save_org_in_field(field); }
enum Item_result result_type () const { return (*ref)->result_type(); }
table_map used_tables() const { return (*ref)->used_tables(); }
+ virtual unsigned int size_of () { return sizeof(*this);}
};
@@ -383,6 +397,7 @@ public:
{
return ref->save_in_field(field);
}
+ virtual unsigned int size_of () { return sizeof(*this);}
};
@@ -417,6 +432,7 @@ public:
table_map used_tables() const { return (table_map) 1L; }
bool const_item() const { return 0; }
bool is_null() { return null_value; }
+ virtual unsigned int size_of () { return sizeof(*this);}
};
@@ -427,6 +443,7 @@ public:
Item_buff() :null_value(0) {}
virtual bool cmp(void)=0;
virtual ~Item_buff(); /*line -e1509 */
+ virtual unsigned int size_of () { return sizeof(*this);}
};
class Item_str_buff :public Item_buff
@@ -437,6 +454,7 @@ public:
Item_str_buff(Item *arg) :item(arg),value(arg->max_length) {}
bool cmp(void);
~Item_str_buff(); // Deallocate String:s
+ virtual unsigned int size_of () { return sizeof(*this);}
};
@@ -447,6 +465,7 @@ class Item_real_buff :public Item_buff
public:
Item_real_buff(Item *item_par) :item(item_par),value(0.0) {}
bool cmp(void);
+ virtual unsigned int size_of () { return sizeof(*this);}
};
class Item_int_buff :public Item_buff
@@ -456,6 +475,7 @@ class Item_int_buff :public Item_buff
public:
Item_int_buff(Item *item_par) :item(item_par),value(0) {}
bool cmp(void);
+ virtual unsigned int size_of () { return sizeof(*this);}
};
@@ -472,6 +492,7 @@ public:
buff= (char*) sql_calloc(length=field->pack_length());
}
bool cmp(void);
+ virtual unsigned int size_of () { return sizeof(*this);}
};
extern Item_buff *new_Item_buff(Item *item);