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
extern uint32_t lower_case_table_names;
25
class Item_ident :public Item
29
We have to store initial values of db_name, table_name and field_name
30
to be able to restore them during cleanup() because they can be
31
updated during fix_fields() to values from Field object and life-time
32
of those is shorter than life-time of Item_field.
34
const char *orig_db_name;
35
const char *orig_table_name;
36
const char *orig_field_name;
39
Name_resolution_context *context;
41
const char *table_name;
42
const char *field_name;
43
bool alias_name_used; /* true if item was resolved against alias */
45
Cached value of index for this field in table->field array, used by prep.
46
stmts for speeding up their re-execution. Holds NO_CACHED_FIELD_INDEX
47
if index value is not known.
49
uint32_t cached_field_index;
51
Cached pointer to table which contains this field, used for the same reason
52
by prep. stmt. too in case then we have not-fully qualified field.
53
0 - means no cached value.
55
TableList *cached_table;
56
st_select_lex *depended_from;
57
Item_ident(Name_resolution_context *context_arg,
58
const char *db_name_arg, const char *table_name_arg,
59
const char *field_name_arg);
60
Item_ident(Session *session, Item_ident *item);
61
const char *full_name() const;
63
bool remove_dependence_processor(unsigned char * arg);
64
virtual void print(String *str, enum_query_type query_type);
65
virtual bool change_context_processor(unsigned char *cntx)
66
{ context= (Name_resolution_context *)cntx; return false; }
67
friend bool insert_fields(Session *session, Name_resolution_context *context,
69
const char *table_name, List_iterator<Item> *it,
74
class Item_ident_for_show :public Item
79
const char *table_name;
81
Item_ident_for_show(Field *par_field, const char *db_arg,
82
const char *table_name_arg)
83
:field(par_field), db_name(db_arg), table_name(table_name_arg)
86
enum Type type() const { return FIELD_ITEM; }
89
String *val_str(String *str);
90
my_decimal *val_decimal(my_decimal *dec);
91
void make_field(Send_field *tmp_field);
94
#endif /* DRIZZLED_ITEM_IDENT_H */