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
21
#ifndef DRIZZLED_TABLE_IDENT_H
22
#define DRIZZLED_TABLE_IDENT_H
27
/* Structure for db & table in sql_yacc */
28
class Table_ident :public memory::SqlAlloc
34
inline Table_ident(LEX_STRING db_arg, LEX_STRING table_arg)
35
:table(table_arg), sel((Select_Lex_Unit *)0)
39
explicit Table_ident(LEX_STRING table_arg)
40
:table(table_arg), sel((Select_Lex_Unit *)0)
45
This constructor is used only for the case when we create a derived
46
table. A derived table has no name and doesn't belong to any database.
47
Later, if there was an alias specified for the table, it will be set
50
explicit Table_ident(Select_Lex_Unit *s) : sel(s)
52
/* We must have a table name here as this is used with add_table_to_list */
53
db.str= empty_c_string; /* a subject to casedn_str */
55
table.str= internal_table_name;
58
bool is_derived_table() const { return test(sel); }
59
inline void change_db(char *db_name)
61
db.str= db_name; db.length= (uint32_t) strlen(db_name);
65
} /* namespace drizzled */
67
#endif /* DRIZZLED_TABLE_IDENT_H */