00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #pragma once
00021
00022 #include <drizzled/item.h>
00023
00024 namespace drizzled {
00025
00026 class Item_ident : public Item
00027 {
00028 protected:
00029
00030
00031
00032
00033
00034
00035 const char *orig_db_name;
00036 const char *orig_table_name;
00037 const char *orig_field_name;
00038
00039 public:
00040 Name_resolution_context *context;
00041 const char *db_name;
00042 const char *table_name;
00043 const char *field_name;
00044 bool alias_name_used;
00045
00046
00047
00048
00049
00050 uint32_t cached_field_index;
00051
00052
00053
00054
00055
00056 TableList *cached_table;
00057 Select_Lex *depended_from;
00058 Item_ident(Name_resolution_context *context_arg,
00059 const char *db_name_arg, const char *table_name_arg,
00060 const char *field_name_arg);
00061 Item_ident(Session *session, Item_ident *item);
00062 const char *full_name() const;
00063 void cleanup();
00064 bool remove_dependence_processor(unsigned char * arg);
00065 virtual void print(String *str);
00066 virtual bool change_context_processor(unsigned char *cntx)
00067 { context= (Name_resolution_context *)cntx; return false; }
00068 friend bool insert_fields(Session *session, Name_resolution_context *context,
00069 const char *db_name,
00070 const char *table_name, List<Item>::iterator *it,
00071 bool any_privileges);
00072 };
00073
00074
00075 class Item_ident_for_show : public Item
00076 {
00077 public:
00078 Field *field;
00079 const char *db_name;
00080 const char *table_name;
00081
00082 Item_ident_for_show(Field *par_field, const char *db_arg,
00083 const char *table_name_arg)
00084 :field(par_field), db_name(db_arg), table_name(table_name_arg)
00085 {}
00086
00087 enum Type type() const { return FIELD_ITEM; }
00088 double val_real();
00089 int64_t val_int();
00090 String *val_str(String *str);
00091 type::Decimal *val_decimal(type::Decimal *dec);
00092 void make_field(SendField *tmp_field);
00093 };
00094
00095 }
00096