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
00027 class Name_resolution_context;
00028 class TableList;
00029 extern uint32_t lower_case_table_names;
00030
00031 class Item_ident :public Item
00032 {
00033 protected:
00034
00035
00036
00037
00038
00039
00040 const char *orig_db_name;
00041 const char *orig_table_name;
00042 const char *orig_field_name;
00043
00044 public:
00045 Name_resolution_context *context;
00046 const char *db_name;
00047 const char *table_name;
00048 const char *field_name;
00049 bool alias_name_used;
00050
00051
00052
00053
00054
00055 uint32_t cached_field_index;
00056
00057
00058
00059
00060
00061 TableList *cached_table;
00062 Select_Lex *depended_from;
00063 Item_ident(Name_resolution_context *context_arg,
00064 const char *db_name_arg, const char *table_name_arg,
00065 const char *field_name_arg);
00066 Item_ident(Session *session, Item_ident *item);
00067 const char *full_name() const;
00068 void cleanup();
00069 bool remove_dependence_processor(unsigned char * arg);
00070 virtual void print(String *str);
00071 virtual bool change_context_processor(unsigned char *cntx)
00072 { context= (Name_resolution_context *)cntx; return false; }
00073 friend bool insert_fields(Session *session, Name_resolution_context *context,
00074 const char *db_name,
00075 const char *table_name, List<Item>::iterator *it,
00076 bool any_privileges);
00077 };
00078
00079
00080 class Item_ident_for_show :public Item
00081 {
00082 public:
00083 Field *field;
00084 const char *db_name;
00085 const char *table_name;
00086
00087 Item_ident_for_show(Field *par_field, const char *db_arg,
00088 const char *table_name_arg)
00089 :field(par_field), db_name(db_arg), table_name(table_name_arg)
00090 {}
00091
00092 enum Type type() const { return FIELD_ITEM; }
00093 double val_real();
00094 int64_t val_int();
00095 String *val_str(String *str);
00096 type::Decimal *val_decimal(type::Decimal *dec);
00097 void make_field(SendField *tmp_field);
00098 };
00099
00100 }
00101