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