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