1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#ifndef DRIZZLED_ITEM_IDENT_H
21
#define DRIZZLED_ITEM_IDENT_H
23
#include "drizzled/item.h"
28
extern uint32_t lower_case_table_names;
30
class Item_ident :public Item
34
We have to store initial values of db_name, table_name and field_name
35
to be able to restore them during cleanup() because they can be
36
updated during fix_fields() to values from Field object and life-time
37
of those is shorter than life-time of Item_field.
39
const char *orig_db_name;
40
const char *orig_table_name;
41
const char *orig_field_name;
44
Name_resolution_context *context;
46
const char *table_name;
47
const char *field_name;
48
bool alias_name_used; /* true if item was resolved against alias */
50
Cached value of index for this field in table->field array, used by prep.
51
stmts for speeding up their re-execution. Holds NO_CACHED_FIELD_INDEX
52
if index value is not known.
54
uint32_t cached_field_index;
56
Cached pointer to table which contains this field, used for the same reason
57
by prep. stmt. too in case then we have not-fully qualified field.
58
0 - means no cached value.
60
TableList *cached_table;
61
Select_Lex *depended_from;
62
Item_ident(Name_resolution_context *context_arg,
63
const char *db_name_arg, const char *table_name_arg,
64
const char *field_name_arg);
65
Item_ident(Session *session, Item_ident *item);
66
const char *full_name() const;
68
bool remove_dependence_processor(unsigned char * arg);
69
virtual void print(String *str, enum_query_type query_type);
70
virtual bool change_context_processor(unsigned char *cntx)
71
{ context= (Name_resolution_context *)cntx; return false; }
72
friend bool insert_fields(Session *session, Name_resolution_context *context,
74
const char *table_name, List_iterator<Item> *it,
79
class Item_ident_for_show :public Item
84
const char *table_name;
86
Item_ident_for_show(Field *par_field, const char *db_arg,
87
const char *table_name_arg)
88
:field(par_field), db_name(db_arg), table_name(table_name_arg)
91
enum Type type() const { return FIELD_ITEM; }
94
String *val_str(String *str);
95
my_decimal *val_decimal(my_decimal *dec);
96
void make_field(SendField *tmp_field);
99
} /* namespace drizzled */
101
#endif /* DRIZZLED_ITEM_IDENT_H */