~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_list.h

  • Committer: Mark Atwood
  • Date: 2011-08-11 03:05:03 UTC
  • mfrom: (2385.1.12 refactor4)
  • Revision ID: me@mark.atwood.name-20110811030503-rp9xjihc5x3y0x4q
mergeĀ lp:~olafvdspek/drizzle/refactor4

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#ifndef DRIZZLED_TABLE_LIST_H
22
 
#define DRIZZLED_TABLE_LIST_H
 
21
#pragma once
23
22
 
24
23
#include <drizzled/nested_join.h>
25
24
#include <drizzled/table.h>
26
25
 
27
 
namespace drizzled
28
 
{
29
 
 
30
 
class Index_hint;
31
 
class COND_EQUAL;
32
 
class Natural_join_column;
33
 
class select_union;
34
 
class Select_Lex_Unit;
35
 
class Select_Lex;
36
 
class Tmp_Table_Param;
37
 
class Item_subselect;
38
 
class Table;
39
 
 
40
 
namespace plugin
41
 
{
42
 
  class StorageEngine;
43
 
}
 
26
namespace drizzled {
44
27
 
45
28
/**
46
29
 * A Table referenced in the FROM clause.
79
62
    next_local(NULL),
80
63
    next_global(NULL),
81
64
    prev_global(NULL),
82
 
    db(NULL),
 
65
    schema(NULL),
83
66
    alias(NULL),
84
67
    table_name(NULL),
85
68
    option(NULL),
103
86
    select_lex(NULL),
104
87
    next_leaf(NULL),
105
88
    outer_join(0),
106
 
    db_length(0),
107
 
    table_name_length(0),
108
89
    dep_tables(0),
109
90
    on_expr_dep_tables(0),
110
91
    nested_join(NULL),
115
96
    is_alias(false),
116
97
    is_fqtn(false),
117
98
    create(false)
118
 
  {}
 
99
  {
 
100
  }
119
101
 
120
102
  /**
121
103
   * List of tables local to a subquery (used by SQL_LIST). Considers
129
111
  TableList **prev_global;
130
112
 
131
113
private:
132
 
  char *db;
 
114
  const char* schema;
133
115
 
134
116
public:
135
 
  const char *getSchemaName()
136
 
  {
137
 
    return db;
138
 
  }
139
 
 
140
 
  char **getSchemaNamePtr()
141
 
  {
142
 
    return &db;
143
 
  }
144
 
 
145
 
  void setSchemaName(char *arg)
146
 
  {
147
 
    db= arg;
 
117
  const char *getSchemaName() const
 
118
  {
 
119
    return schema;
 
120
  }
 
121
 
 
122
  void setSchemaName(const char* v)
 
123
  {
 
124
    schema= v;
148
125
  }
149
126
 
150
127
  const char *alias;
151
128
 
152
129
private:
153
 
  char *table_name;
 
130
  const char* table_name;
154
131
 
155
132
public:
156
 
  const char *getTableName()
 
133
  const char *getTableName() const
157
134
  {
158
135
    return table_name;
159
136
  }
160
137
 
161
 
  char **getTableNamePtr()
162
 
  {
163
 
    return &table_name;
164
 
  }
165
 
 
166
 
  void setTableName(char *arg)
167
 
  {
168
 
    table_name= arg;
169
 
  }
170
 
 
171
 
  char *option; ///< Used by cache index
 
138
  void setTableName(const char* v)
 
139
  {
 
140
    table_name= v;
 
141
  }
 
142
 
 
143
  const char *option; ///< Used by cache index
172
144
  Item *on_expr; ///< Used with outer join
173
145
  Table *table; ///< opened table
174
146
  /**
242
214
  TableList *next_leaf;
243
215
  thr_lock_type lock_type;
244
216
  uint32_t outer_join; ///< Which join type
245
 
  size_t db_length;
246
 
  size_t table_name_length;
247
217
 
248
218
  void set_underlying_merge();
249
219
  bool setup_underlying(Session *session);
258
228
   * 
259
229
   * @param str   string where table should be printed
260
230
   */
261
 
  void print(Session *session, String *str, enum_query_type query_type);
 
231
  void print(Session *session, String *str);
262
232
  /**
263
233
   * Sets insert_values buffer
264
234
   *
400
370
  friend std::ostream& operator<<(std::ostream& output, const TableList &list)
401
371
  {
402
372
    output << "TableList:(";
403
 
    output << list.db;
 
373
    output << list.getSchemaName();
404
374
    output << ", ";
405
 
    output << list.table_name;
 
375
    output << list.getTableName();
406
376
    output << ", ";
407
377
    output << list.alias;
408
378
    output << ", ";
560
530
 
561
531
} /* namespace drizzled */
562
532
 
563
 
#endif /* DRIZZLED_TABLE_LIST_H */