~drizzle-trunk/drizzle/development

390.1.2 by Monty Taylor
Fixed copyright headers in drizzled/
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
4
 *  Copyright (C) 2008 Sun Microsystems
5
 *
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; either version 2 of the License, or
9
 *  (at your option) any later version.
10
 *
11
 *  This program is distributed in the hope that it will be useful,
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 *  GNU General Public License for more details.
15
 *
16
 *  You should have received a copy of the GNU General Public License
17
 *  along with this program; if not, write to the Free Software
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 */
1 by brian
clean slate
20
327.1.5 by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h
21
/* Structs that defines the Table */
1 by brian
clean slate
22
327.1.2 by Brian Aker
Commiting next pass of Table class cleanup.
23
#ifndef DRIZZLED_TABLE_H
24
#define DRIZZLED_TABLE_H
25
26
#include <storage/myisam/myisam.h>
327.2.3 by Brian Aker
Refactoring of class Table
27
#include <drizzled/order.h>
28
#include <drizzled/filesort_info.h>
327.2.4 by Brian Aker
Refactoring table.h
29
#include <drizzled/natural_join_column.h>
353 by Brian Aker
Moved Field iterator out to its own definition.
30
#include <drizzled/field_iterator.h>
520.8.6 by Monty Taylor
Removed handler from common_includes.
31
#include <mysys/hash.h>
32
#include <drizzled/handler.h>
575.4.5 by Monty Taylor
Added lex_string.h header.
33
#include <drizzled/lex_string.h>
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
34
#include <drizzled/table_list.h>
798 by Brian Aker
Updated table_share tto its own file (yess, it will eventually go away).
35
#include <drizzled/table_share.h>
982.1.1 by Padraig O'Sullivan
Initial work on removing MY_BITMAP from the Drizzle code base. For a start,
36
#include <bitset>
327.1.2 by Brian Aker
Commiting next pass of Table class cleanup.
37
584.1.13 by Monty Taylor
Split out a little more code. Removed table_list.h from common_includes.
38
class Item;
1 by brian
clean slate
39
class Item_subselect;
848 by Brian Aker
typdef class removal (just... use the name of the class).
40
class Select_Lex_Unit;
846 by Brian Aker
Removing on typedeffed class.
41
class Select_Lex;
1 by brian
clean slate
42
class COND_EQUAL;
43
class Security_context;
327.2.4 by Brian Aker
Refactoring table.h
44
class TableList;
1 by brian
clean slate
45
46
/*************************************************************************/
47
48
49
class Field_timestamp;
50
class Field_blob;
51
52
typedef enum enum_table_category TABLE_CATEGORY;
53
54
TABLE_CATEGORY get_table_category(const LEX_STRING *db,
55
                                  const LEX_STRING *name);
56
57
366 by Patrick Galbraith
Ulong conversion
58
extern uint32_t refresh_version;
1 by brian
clean slate
59
327.2.3 by Brian Aker
Refactoring of class Table
60
typedef struct st_table_field_w_type
61
{
62
  LEX_STRING name;
63
  LEX_STRING type;
64
  LEX_STRING cset;
65
} TABLE_FIELD_W_TYPE;
66
520.1.22 by Brian Aker
Second pass of thd cleanup
67
bool create_myisam_from_heap(Session *session, Table *table,
327.1.2 by Brian Aker
Commiting next pass of Table class cleanup.
68
                             MI_COLUMNDEF *start_recinfo,
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
69
                             MI_COLUMNDEF **recinfo,
327.1.2 by Brian Aker
Commiting next pass of Table class cleanup.
70
                             int error, bool ignore_last_dupp_key_error);
71
327.1.1 by Brian Aker
First pass in encapsulating table (it is now an object, no longer a structure).
72
class Table {
327.1.5 by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h
73
327.1.1 by Brian Aker
First pass in encapsulating table (it is now an object, no longer a structure).
74
public:
1 by brian
clean slate
75
  TABLE_SHARE	*s;
327.1.1 by Brian Aker
First pass in encapsulating table (it is now an object, no longer a structure).
76
  Table() {}                               /* Remove gcc warning */
77
327.1.5 by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h
78
  /* SHARE methods */
327.1.1 by Brian Aker
First pass in encapsulating table (it is now an object, no longer a structure).
79
  inline TABLE_SHARE *getShare() { return s; } /* Get rid of this long term */
80
  inline void setShare(TABLE_SHARE *new_share) { s= new_share; } /* Get rid of this long term */
482 by Brian Aker
Remove uint.
81
  inline uint32_t sizeKeys() { return s->keys; }
82
  inline uint32_t sizeFields() { return s->fields; }
83
  inline uint32_t getRecordLength() { return s->reclength; }
84
  inline uint32_t sizeBlobFields() { return s->blob_fields; }
85
  inline uint32_t *getBlobField() { return s->blob_field; }
86
  inline uint32_t getNullBytes() { return s->null_bytes; }
87
  inline uint32_t getNullFields() { return s->null_fields; }
327.1.1 by Brian Aker
First pass in encapsulating table (it is now an object, no longer a structure).
88
  inline unsigned char *getDefaultValues() { return s->default_values; }
89
90
  inline bool isDatabaseLowByteFirst() { return s->db_low_byte_first; }		/* Portable row format */
91
  inline bool isCrashed() { return s->crashed; }
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
92
  inline bool isNameLock() { return s->name_lock; }
327.1.1 by Brian Aker
First pass in encapsulating table (it is now an object, no longer a structure).
93
  inline bool isReplaceWithNameLock() { return s->replace_with_name_lock; }
94
  inline bool isWaitingOnCondition() { return s->waiting_on_cond; }                 /* Protection against free */
95
327.1.5 by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h
96
  /* For TMP tables, should be pulled out as a class */
327.1.2 by Brian Aker
Commiting next pass of Table class cleanup.
97
  void updateCreateInfo(HA_CREATE_INFO *create_info);
982.1.3 by Padraig O'Sullivan
Various small cleanups to numerous files to now have calls to the correct
98
  void setup_tmp_table_column_bitmaps();
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
99
  bool create_myisam_tmp_table(KEY *keyinfo,
327.1.2 by Brian Aker
Commiting next pass of Table class cleanup.
100
                               MI_COLUMNDEF *start_recinfo,
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
101
                               MI_COLUMNDEF **recinfo,
327.1.2 by Brian Aker
Commiting next pass of Table class cleanup.
102
                               uint64_t options);
520.1.22 by Brian Aker
Second pass of thd cleanup
103
  void free_tmp_table(Session *session);
327.1.2 by Brian Aker
Commiting next pass of Table class cleanup.
104
  bool open_tmp_table();
481 by Brian Aker
Remove all of uchar.
105
  size_t max_row_length(const unsigned char *data);
482 by Brian Aker
Remove uint.
106
  uint32_t find_shortest_key(const key_map *usable_keys);
355 by Brian Aker
More Table cleanup
107
  bool compare_record(Field **ptr);
108
  bool compare_record();
327.1.2 by Brian Aker
Commiting next pass of Table class cleanup.
109
482 by Brian Aker
Remove uint.
110
  bool table_check_intact(const uint32_t table_f_count, const TABLE_FIELD_W_TYPE *table_def);
327.2.3 by Brian Aker
Refactoring of class Table
111
327.1.5 by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h
112
  /* See if this can be blown away */
482 by Brian Aker
Remove uint.
113
  inline uint32_t getDBStat () { return db_stat; }
114
  inline uint32_t setDBStat () { return db_stat; }
850 by Brian Aker
More class creation.
115
  uint32_t db_stat;		/* mode of file as in handler.h */
327.1.5 by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h
116
1 by brian
clean slate
117
  handler	*file;
327.1.1 by Brian Aker
First pass in encapsulating table (it is now an object, no longer a structure).
118
  Table *next, *prev;
1 by brian
clean slate
119
520.1.21 by Brian Aker
THD -> Session rename
120
  Session	*in_use;                        /* Which thread uses this */
1 by brian
clean slate
121
  Field **field;			/* Pointer to fields */
122
481 by Brian Aker
Remove all of uchar.
123
  unsigned char *record[2];			/* Pointer to records */
124
  unsigned char *write_row_record;		/* Used as optimisation in
520.1.21 by Brian Aker
THD -> Session rename
125
					   Session::write_row */
481 by Brian Aker
Remove all of uchar.
126
  unsigned char *insert_values;                  /* used by INSERT ... UPDATE */
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
127
  /*
128
    Map of keys that can be used to retrieve all data from this table
1 by brian
clean slate
129
    needed by the query without reading the row.
130
  */
131
  key_map covering_keys;
132
  key_map quick_keys, merge_keys;
133
  /*
134
    A set of keys that can be used in the query that references this
135
    table.
136
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
137
    All indexes disabled on the table's TABLE_SHARE (see Table::s) will be
327.1.5 by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h
138
    subtracted from this set upon instantiation. Thus for any Table t it holds
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
139
    that t.keys_in_use_for_query is a subset of t.s.keys_in_use. Generally we
1 by brian
clean slate
140
    must not introduce any new keys here (see setup_tables).
141
142
    The set is implemented as a bitmap.
143
  */
144
  key_map keys_in_use_for_query;
145
  /* Map of keys that can be used to calculate GROUP BY without sorting */
146
  key_map keys_in_use_for_group_by;
147
  /* Map of keys that can be used to calculate ORDER BY without sorting */
148
  key_map keys_in_use_for_order_by;
149
  KEY  *key_info;			/* data of keys in database */
150
151
  Field *next_number_field;		/* Set if next_number is activated */
152
  Field *found_next_number_field;	/* Set on open */
153
  Field_timestamp *timestamp_field;
383.7.1 by Andrey Zhakov
Initial submit of code and tests
154
  Field **vfield;                       /* Pointer to virtual fields*/
1 by brian
clean slate
155
327.2.4 by Brian Aker
Refactoring table.h
156
  TableList *pos_in_table_list;/* Element referring to this table */
327.2.3 by Brian Aker
Refactoring of class Table
157
  order_st *group;
1 by brian
clean slate
158
  const char	*alias;            	  /* alias or table name */
481 by Brian Aker
Remove all of uchar.
159
  unsigned char		*null_flags;
982.1.11 by Padraig O'Sullivan
Reverted my changes for replacing Bitmap<> for the moment. Going to fix up
160
  my_bitmap_map	*bitmap_init_value;
982.1.1 by Padraig O'Sullivan
Initial work on removing MY_BITMAP from the Drizzle code base. For a start,
161
  std::bitset<MAX_FIELDS> def_read_set, def_write_set, tmp_set; /* containers */
162
  std::bitset<MAX_FIELDS> *read_set, *write_set;                /* Active column sets */
1 by brian
clean slate
163
  /*
164
   The ID of the query that opened and is using this table. Has different
165
   meanings depending on the table type.
166
167
   Temporary tables:
168
520.1.22 by Brian Aker
Second pass of thd cleanup
169
   table->query_id is set to session->query_id for the duration of a statement
1 by brian
clean slate
170
   and is reset to 0 once it is closed by the same statement. A non-zero
171
   table->query_id means that a statement is using the table even if it's
172
   not the current statement (table is in use by some outer statement).
173
174
   Non-temporary tables:
175
520.1.22 by Brian Aker
Second pass of thd cleanup
176
   Under pre-locked or LOCK TABLES mode: query_id is set to session->query_id
1 by brian
clean slate
177
   for the duration of a statement and is reset to 0 once it is closed by
178
   the same statement. A non-zero query_id is used to control which tables
179
   in the list of pre-opened and locked tables are actually being used.
180
  */
181
  query_id_t	query_id;
182
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
183
  /*
51.1.70 by Jay Pipes
Removed/replaced DBUG symbols and removed sql_test.cc from Makefile
184
    For each key that has quick_keys.is_set(key) == true: estimate of #records
1 by brian
clean slate
185
    and max #key parts that range access would use.
186
  */
187
  ha_rows	quick_rows[MAX_KEY];
188
189
  /* Bitmaps of key parts that =const for the entire join. */
190
  key_part_map  const_key_parts[MAX_KEY];
191
192
  uint		quick_key_parts[MAX_KEY];
193
  uint		quick_n_ranges[MAX_KEY];
194
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
195
  /*
1 by brian
clean slate
196
    Estimate of number of records that satisfy SARGable part of the table
197
    condition, or table->file->records if no SARGable condition could be
198
    constructed.
199
    This value is used by join optimizer as an estimate of number of records
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
200
    that will pass the table condition (condition that depends on fields of
1 by brian
clean slate
201
    this table and constants)
202
  */
203
  ha_rows       quick_condition_rows;
204
205
  /*
206
    If this table has TIMESTAMP field with auto-set property (pointed by
207
    timestamp_field member) then this variable indicates during which
208
    operations (insert only/on update/in both cases) we should set this
209
    field to current timestamp. If there are no such field in this table
210
    or we should not automatically set its value during execution of current
211
    statement then the variable contains TIMESTAMP_NO_AUTO_SET (i.e. 0).
212
213
    Value of this variable is set for each statement in open_table() and
214
    if needed cleared later in statement processing code (see mysql_update()
215
    as example).
216
  */
217
  timestamp_auto_set_type timestamp_field_type;
218
  table_map	map;                    /* ID bit of table (1,2,4,8,16...) */
219
482 by Brian Aker
Remove uint.
220
  uint32_t          lock_position;          /* Position in DRIZZLE_LOCK.table */
221
  uint32_t          lock_data_start;        /* Start pos. in DRIZZLE_LOCK.locks */
222
  uint32_t          lock_count;             /* Number of locks */
1 by brian
clean slate
223
  uint		tablenr,used_fields;
482 by Brian Aker
Remove uint.
224
  uint32_t          temp_pool_slot;		/* Used by intern temp tables */
1 by brian
clean slate
225
  uint		status;                 /* What's in record[0] */
226
  /* number of select if it is derived table */
482 by Brian Aker
Remove uint.
227
  uint32_t          derived_select_number;
1 by brian
clean slate
228
  int		current_lock;           /* Type of lock on table */
274 by Brian Aker
my_bool conversion in Table
229
  bool copy_blobs;			/* copy_blobs when storing */
1 by brian
clean slate
230
231
  /*
232
    0 or JOIN_TYPE_{LEFT|RIGHT}. Currently this is only compared to 0.
233
    If maybe_null !=0, this table is inner w.r.t. some outer join operation,
234
    and null_row may be true.
235
  */
327.1.3 by Brian Aker
Cleaned up depend in Proto utils. Modified int to bool. Put TmpTable class
236
  bool maybe_null;
237
1 by brian
clean slate
238
  /*
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
239
    If true, the current table row is considered to have all columns set to
1 by brian
clean slate
240
    NULL, including columns declared as "not null" (see maybe_null).
241
  */
274 by Brian Aker
my_bool conversion in Table
242
  bool null_row;
1 by brian
clean slate
243
274 by Brian Aker
my_bool conversion in Table
244
  bool force_index;
245
  bool distinct,const_table,no_rows;
246
  bool key_read, no_keyread;
1 by brian
clean slate
247
  /*
248
    Placeholder for an open table which prevents other connections
249
    from taking name-locks on this table. Typically used with
250
    TABLE_SHARE::version member to take an exclusive name-lock on
251
    this table name -- a name lock that not only prevents other
252
    threads from opening the table, but also blocks other name
253
    locks. This is achieved by:
254
    - setting open_placeholder to 1 - this will block other name
255
      locks, as wait_for_locked_table_name will be forced to wait,
256
      see table_is_used for details.
257
    - setting version to 0 - this will force other threads to close
258
      the instance of this table and wait (this is the same approach
259
      as used for usual name locks).
260
    An exclusively name-locked table currently can have no handler
261
    object associated with it (db_stat is always 0), but please do
262
    not rely on that.
263
  */
274 by Brian Aker
my_bool conversion in Table
264
  bool open_placeholder;
265
  bool locked_by_logger;
266
  bool no_replicate;
267
  bool locked_by_name;
268
  bool no_cache;
1 by brian
clean slate
269
  /* To signal that the table is associated with a HANDLER statement */
274 by Brian Aker
my_bool conversion in Table
270
  bool open_by_handler;
1 by brian
clean slate
271
  /*
272
    To indicate that a non-null value of the auto_increment field
273
    was provided by the user or retrieved from the current record.
274
    Used only in the MODE_NO_AUTO_VALUE_ON_ZERO mode.
275
  */
274 by Brian Aker
my_bool conversion in Table
276
  bool auto_increment_field_not_null;
277
  bool insert_or_update;             /* Can be used by the handler */
278
  bool alias_name_used;		/* true if table_name is alias */
279
  bool get_fields_in_item_tree;      /* Signal to fix_field */
1 by brian
clean slate
280
281
  REGINFO reginfo;			/* field connections */
282
  MEM_ROOT mem_root;
327.2.3 by Brian Aker
Refactoring of class Table
283
  filesort_info_st sort;
1 by brian
clean slate
284
285
  bool fill_item_list(List<Item> *item_list) const;
286
  void reset_item_list(List<Item> *item_list) const;
287
  void clear_column_bitmaps(void);
288
  void prepare_for_position(void);
982.1.1 by Padraig O'Sullivan
Initial work on removing MY_BITMAP from the Drizzle code base. For a start,
289
  void mark_columns_used_by_index_no_reset(uint32_t index, std::bitset<MAX_FIELDS> *map);
482 by Brian Aker
Remove uint.
290
  void mark_columns_used_by_index(uint32_t index);
1 by brian
clean slate
291
  void restore_column_maps_after_mark_index();
292
  void mark_auto_increment_column(void);
293
  void mark_columns_needed_for_update(void);
294
  void mark_columns_needed_for_delete(void);
295
  void mark_columns_needed_for_insert(void);
383.7.1 by Andrey Zhakov
Initial submit of code and tests
296
  void mark_virtual_columns(void);
982.1.1 by Padraig O'Sullivan
Initial work on removing MY_BITMAP from the Drizzle code base. For a start,
297
  inline void column_bitmaps_set(std::bitset<MAX_FIELDS> *read_set_arg,
298
                                 std::bitset<MAX_FIELDS> *write_set_arg)
1 by brian
clean slate
299
  {
300
    read_set= read_set_arg;
301
    write_set= write_set_arg;
302
    if (file)
303
      file->column_bitmaps_signal();
304
  }
982.1.1 by Padraig O'Sullivan
Initial work on removing MY_BITMAP from the Drizzle code base. For a start,
305
  inline void column_bitmaps_set_no_signal(std::bitset<MAX_FIELDS> *read_set_arg,
306
                                           std::bitset<MAX_FIELDS> *write_set_arg)
1 by brian
clean slate
307
  {
308
    read_set= read_set_arg;
309
    write_set= write_set_arg;
310
  }
354 by Brian Aker
Refactor of Table methods.
311
982.1.1 by Padraig O'Sullivan
Initial work on removing MY_BITMAP from the Drizzle code base. For a start,
312
  void restore_column_map(std::bitset<MAX_FIELDS> *old);
354 by Brian Aker
Refactor of Table methods.
313
982.1.1 by Padraig O'Sullivan
Initial work on removing MY_BITMAP from the Drizzle code base. For a start,
314
  std::bitset<MAX_FIELDS> *use_all_columns(std::bitset<MAX_FIELDS> *bitmap);
1 by brian
clean slate
315
  inline void use_all_columns()
316
  {
317
    column_bitmaps_set(&s->all_set, &s->all_set);
318
  }
354 by Brian Aker
Refactor of Table methods.
319
1 by brian
clean slate
320
  inline void default_column_bitmaps()
321
  {
322
    read_set= &def_read_set;
323
    write_set= &def_write_set;
324
  }
354 by Brian Aker
Refactor of Table methods.
325
1 by brian
clean slate
326
  /* Is table open or should be treated as such by name-locking? */
327
  inline bool is_name_opened() { return db_stat || open_placeholder; }
328
  /*
329
    Is this instance of the table should be reopen or represents a name-lock?
330
  */
331
  inline bool needs_reopen_or_name_lock()
332
  { return s->version != refresh_version; }
354 by Brian Aker
Refactor of Table methods.
333
334
  int report_error(int error);
793 by Brian Aker
Pass through on refactoring functions to clases.
335
  int closefrm(bool free_share);
336
  uint32_t tmpkeyval();
934.1.1 by Brian Aker
Moved two functions in classes.
337
338
  /**
339
    clean/setup table fields and map.
340
341
    @param table        Table structure pointer (which should be setup)
342
    @param table_list   TableList structure pointer (owner of Table)
343
    @param tablenr     table number
344
  */
345
  void setup_table_map(TableList *table_list, uint32_t tablenr);
346
  inline void mark_as_null_row()
347
  {
348
    null_row=1;
349
    status|=STATUS_NULL_ROW;
350
    memset(null_flags, 255, s->null_bytes);
351
  }
352
1 by brian
clean slate
353
};
354
575.4.7 by Monty Taylor
More header cleanup.
355
Table *create_virtual_tmp_table(Session *session,
356
                                List<Create_field> &field_list);
357
1 by brian
clean slate
358
typedef struct st_foreign_key_info
359
{
360
  LEX_STRING *forein_id;
361
  LEX_STRING *referenced_db;
362
  LEX_STRING *referenced_table;
363
  LEX_STRING *update_method;
364
  LEX_STRING *delete_method;
365
  LEX_STRING *referenced_key_name;
366
  List<LEX_STRING> foreign_fields;
367
  List<LEX_STRING> referenced_fields;
368
} FOREIGN_KEY_INFO;
369
370
typedef struct st_field_info
371
{
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
372
  /**
373
      This is used as column name.
1 by brian
clean slate
374
  */
375
  const char* field_name;
376
  /**
377
     For string-type columns, this is the maximum number of
378
     characters. Otherwise, it is the 'display-length' for the column.
379
  */
482 by Brian Aker
Remove uint.
380
  uint32_t field_length;
1 by brian
clean slate
381
  /**
382
     This denotes data type for the column. For the most part, there seems to
383
     be one entry in the enum for each SQL data type, although there seem to
384
     be a number of additional entries in the enum.
385
  */
386
  enum enum_field_types field_type;
387
  int value;
388
  /**
389
     This is used to set column attributes. By default, columns are @c NOT
390
     @c NULL and @c SIGNED, and you can deviate from the default
391
     by setting the appopriate flags. You can use either one of the flags
392
     @c MY_I_S_MAYBE_NULL and @cMY_I_S_UNSIGNED or
393
     combine them using the bitwise or operator @c |. Both flags are
394
     defined in table.h.
395
   */
482 by Brian Aker
Remove uint.
396
  uint32_t field_flags;        // Field atributes(maybe_null, signed, unsigned etc.)
1 by brian
clean slate
397
  const char* old_name;
398
  /**
399
     This should be one of @c SKIP_OPEN_TABLE,
400
     @c OPEN_FRM_ONLY or @c OPEN_FULL_TABLE.
401
  */
482 by Brian Aker
Remove uint.
402
  uint32_t open_method;
1 by brian
clean slate
403
} ST_FIELD_INFO;
404
405
327.2.4 by Brian Aker
Refactoring table.h
406
class TableList;
1 by brian
clean slate
407
typedef class Item COND;
408
971.1.68 by Monty Taylor
Renamed ST_SCHEMA_TABLE to InfoSchemaTable. One step down towards making the darned thing a class. (/me shudders)
409
struct InfoSchemaTable
1 by brian
clean slate
410
{
411
  const char* table_name;
412
  ST_FIELD_INFO *fields_info;
413
  /* Create information_schema table */
520.1.22 by Brian Aker
Second pass of thd cleanup
414
  Table *(*create_table)  (Session *session, TableList *table_list);
1 by brian
clean slate
415
  /* Fill table with data */
520.1.22 by Brian Aker
Second pass of thd cleanup
416
  int (*fill_table) (Session *session, TableList *tables, COND *cond);
1 by brian
clean slate
417
  /* Handle fileds for old SHOW */
971.1.68 by Monty Taylor
Renamed ST_SCHEMA_TABLE to InfoSchemaTable. One step down towards making the darned thing a class. (/me shudders)
418
  int (*old_format) (Session *session, struct InfoSchemaTable *schema_table);
520.1.22 by Brian Aker
Second pass of thd cleanup
419
  int (*process_table) (Session *session, TableList *tables, Table *table,
1 by brian
clean slate
420
                        bool res, LEX_STRING *db_name, LEX_STRING *table_name);
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
421
  int idx_field1, idx_field2;
1 by brian
clean slate
422
  bool hidden;
482 by Brian Aker
Remove uint.
423
  uint32_t i_s_requested_object;  /* the object we need to open(Table | VIEW) */
327.1.5 by Brian Aker
Refactor around classes. TABLE_LIST has been factored out of table.h
424
};
1 by brian
clean slate
425
426
427
#define JOIN_TYPE_LEFT	1
428
#define JOIN_TYPE_RIGHT	2
429
430
struct st_lex;
431
class select_union;
851 by Brian Aker
Class rewrite of Session (aka get all of the junk out)
432
class Tmp_Table_Param;
1 by brian
clean slate
433
434
typedef struct st_changed_table_list
435
{
436
  struct	st_changed_table_list *next;
437
  char		*key;
205 by Brian Aker
uint32 -> uin32_t
438
  uint32_t        key_length;
327.2.4 by Brian Aker
Refactoring table.h
439
} CHANGED_TableList;
1 by brian
clean slate
440
441
352 by Brian Aker
Merge of Brian's tree to main tree.
442
typedef struct st_open_table_list
443
{
1 by brian
clean slate
444
  struct st_open_table_list *next;
445
  char	*db,*table;
205 by Brian Aker
uint32 -> uin32_t
446
  uint32_t in_use,locked;
327.2.4 by Brian Aker
Refactoring table.h
447
} OPEN_TableList;
1 by brian
clean slate
448
327.2.3 by Brian Aker
Refactoring of class Table
449
327.1.2 by Brian Aker
Commiting next pass of Table class cleanup.
450
#endif /* DRIZZLED_TABLE_H */