~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table.h

  • Committer: Monty Taylor
  • Date: 2009-03-04 02:16:28 UTC
  • mto: (917.1.2 mordred)
  • mto: This revision was merged to the branch mainline in revision 912.
  • Revision ID: mordred@inaugust.com-20090304021628-rfq0b16uoi09g8tx
Fix to make VPATH builds work again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include <drizzled/order.h>
28
28
#include <drizzled/filesort_info.h>
29
29
#include <drizzled/natural_join_column.h>
30
 
#include <drizzled/nested_join.h>
31
30
#include <drizzled/field_iterator.h>
 
31
#include <mysys/hash.h>
 
32
#include <drizzled/handler.h>
 
33
#include <drizzled/lex_string.h>
 
34
#include <drizzled/table_list.h>
 
35
#include <drizzled/table_share.h>
32
36
 
33
 
class Item;                             /* Needed by order_st */
 
37
class Item;
34
38
class Item_subselect;
35
 
class st_select_lex_unit;
36
 
class st_select_lex;
 
39
class Select_Lex_Unit;
 
40
class Select_Lex;
37
41
class COND_EQUAL;
38
42
class Security_context;
39
43
class TableList;
40
44
 
41
45
/*************************************************************************/
42
46
 
43
 
enum tmp_table_type
44
 
{
45
 
  NO_TMP_TABLE, NON_TRANSACTIONAL_TMP_TABLE, TRANSACTIONAL_TMP_TABLE,
46
 
  INTERNAL_TMP_TABLE, SYSTEM_TMP_TABLE, TMP_TABLE_FRM_FILE_ONLY
47
 
};
48
 
 
49
 
bool mysql_frm_type(THD *thd, char *path, enum legacy_db_type *dbt);
50
 
 
51
 
 
52
 
enum release_type { RELEASE_NORMAL, RELEASE_WAIT_FOR_DROP };
53
 
 
54
 
/*
55
 
  Values in this enum are used to indicate how a tables TIMESTAMP field
56
 
  should be treated. It can be set to the current timestamp on insert or
57
 
  update or both.
58
 
  WARNING: The values are used for bit operations. If you change the
59
 
  enum, you must keep the bitwise relation of the values. For example:
60
 
  (int) TIMESTAMP_AUTO_SET_ON_BOTH must be equal to
61
 
  (int) TIMESTAMP_AUTO_SET_ON_INSERT | (int) TIMESTAMP_AUTO_SET_ON_UPDATE.
62
 
  We use an enum here so that the debugger can display the value names.
63
 
*/
64
 
enum timestamp_auto_set_type
65
 
{
66
 
  TIMESTAMP_NO_AUTO_SET= 0, TIMESTAMP_AUTO_SET_ON_INSERT= 1,
67
 
  TIMESTAMP_AUTO_SET_ON_UPDATE= 2, TIMESTAMP_AUTO_SET_ON_BOTH= 3
68
 
};
69
 
#define clear_timestamp_auto_bits(_target_, _bits_) \
70
 
  (_target_)= (enum timestamp_auto_set_type)((int)(_target_) & ~(int)(_bits_))
71
47
 
72
48
class Field_timestamp;
73
49
class Field_blob;
74
50
 
75
 
/**
76
 
  Category of table found in the table share.
77
 
*/
78
 
enum enum_table_category
79
 
{
80
 
  /**
81
 
    Unknown value.
82
 
  */
83
 
  TABLE_UNKNOWN_CATEGORY=0,
84
 
 
85
 
  /**
86
 
    Temporary table.
87
 
    The table is visible only in the session.
88
 
    Therefore,
89
 
    - FLUSH TABLES WITH READ LOCK
90
 
    - SET GLOBAL READ_ONLY = ON
91
 
    do not apply to this table.
92
 
    Note that LOCK Table t FOR READ/WRITE
93
 
    can be used on temporary tables.
94
 
    Temporary tables are not part of the table cache.
95
 
  */
96
 
  TABLE_CATEGORY_TEMPORARY=1,
97
 
 
98
 
  /**
99
 
    User table.
100
 
    These tables do honor:
101
 
    - LOCK Table t FOR READ/WRITE
102
 
    - FLUSH TABLES WITH READ LOCK
103
 
    - SET GLOBAL READ_ONLY = ON
104
 
    User tables are cached in the table cache.
105
 
  */
106
 
  TABLE_CATEGORY_USER=2,
107
 
 
108
 
  /**
109
 
    Information schema tables.
110
 
    These tables are an interface provided by the system
111
 
    to inspect the system metadata.
112
 
    These tables do *not* honor:
113
 
    - LOCK Table t FOR READ/WRITE
114
 
    - FLUSH TABLES WITH READ LOCK
115
 
    - SET GLOBAL READ_ONLY = ON
116
 
    as there is no point in locking explicitely
117
 
    an INFORMATION_SCHEMA table.
118
 
    Nothing is directly written to information schema tables.
119
 
    Note that this value is not used currently,
120
 
    since information schema tables are not shared,
121
 
    but implemented as session specific temporary tables.
122
 
  */
123
 
  /*
124
 
    TODO: Fixing the performance issues of I_S will lead
125
 
    to I_S tables in the table cache, which should use
126
 
    this table type.
127
 
  */
128
 
  TABLE_CATEGORY_INFORMATION
129
 
};
130
51
typedef enum enum_table_category TABLE_CATEGORY;
131
52
 
132
53
TABLE_CATEGORY get_table_category(const LEX_STRING *db,
133
54
                                  const LEX_STRING *name);
134
55
 
135
 
/*
136
 
  This structure is shared between different table objects. There is one
137
 
  instance of table share per one table in the database.
138
 
*/
139
 
 
140
 
typedef struct st_table_share
141
 
{
142
 
  st_table_share() {}                    /* Remove gcc warning */
143
 
 
144
 
  /** Category of this table. */
145
 
  TABLE_CATEGORY table_category;
146
 
 
147
 
  /* hash of field names (contains pointers to elements of field array) */
148
 
  HASH  name_hash;                      /* hash of field names */
149
 
  MEM_ROOT mem_root;
150
 
  TYPELIB keynames;                     /* Pointers to keynames */
151
 
  TYPELIB fieldnames;                   /* Pointer to fieldnames */
152
 
  TYPELIB *intervals;                   /* pointer to interval info */
153
 
  pthread_mutex_t mutex;                /* For locking the share  */
154
 
  pthread_cond_t cond;                  /* To signal that share is ready */
155
 
  struct st_table_share *next,          /* Link to unused shares */
156
 
    **prev;
157
 
 
158
 
  /* The following is copied to each Table on OPEN */
159
 
  Field **field;
160
 
  Field **found_next_number_field;
161
 
  Field *timestamp_field;               /* Used only during open */
162
 
  KEY  *key_info;                       /* data of keys in database */
163
 
  uint  *blob_field;                    /* Index to blobs in Field arrray*/
164
 
 
165
 
  unsigned char *default_values;                /* row with default values */
166
 
  LEX_STRING comment;                   /* Comment about table */
167
 
  const CHARSET_INFO *table_charset; /* Default charset of string fields */
168
 
 
169
 
  MY_BITMAP all_set;
170
 
  /*
171
 
    Key which is used for looking-up table in table cache and in the list
172
 
    of thread's temporary tables. Has the form of:
173
 
      "database_name\0table_name\0" + optional part for temporary tables.
174
 
 
175
 
    Note that all three 'table_cache_key', 'db' and 'table_name' members
176
 
    must be set (and be non-zero) for tables in table cache. They also
177
 
    should correspond to each other.
178
 
    To ensure this one can use set_table_cache() methods.
179
 
  */
180
 
  LEX_STRING table_cache_key;
181
 
  LEX_STRING db;                        /* Pointer to db */
182
 
  LEX_STRING table_name;                /* Table name (for open) */
183
 
  LEX_STRING path;      /* Path to .frm file (from datadir) */
184
 
  LEX_STRING normalized_path;           /* unpack_filename(path) */
185
 
  LEX_STRING connect_string;
186
 
 
187
 
  /*
188
 
     Set of keys in use, implemented as a Bitmap.
189
 
     Excludes keys disabled by ALTER Table ... DISABLE KEYS.
190
 
  */
191
 
  key_map keys_in_use;
192
 
  key_map keys_for_keyread;
193
 
  ha_rows min_rows, max_rows;           /* create information */
194
 
  uint32_t   avg_row_length;            /* create information */
195
 
  uint32_t   block_size;                   /* create information */
196
 
  uint32_t   version, mysql_version;
197
 
  uint32_t   timestamp_offset;          /* Set to offset+1 of record */
198
 
  uint32_t   reclength;                 /* Recordlength */
199
 
 
200
 
  plugin_ref db_plugin;                 /* storage engine plugin */
201
 
  inline handlerton *db_type() const    /* table_type for handler */
202
 
  {
203
 
    // assert(db_plugin);
204
 
    return db_plugin ? plugin_data(db_plugin, handlerton*) : NULL;
205
 
  }
206
 
  enum row_type row_type;               /* How rows are stored */
207
 
  enum tmp_table_type tmp_table;
208
 
  enum ha_choice transactional;
209
 
  enum ha_choice page_checksum;
210
 
 
211
 
  uint32_t ref_count;                       /* How many Table objects uses this */
212
 
  uint32_t open_count;                  /* Number of tables in open list */
213
 
  uint32_t blob_ptr_size;                       /* 4 or 8 */
214
 
  uint32_t key_block_size;                      /* create key_block_size, if used */
215
 
  uint32_t null_bytes, last_null_bit_pos;
216
 
  uint32_t fields;                              /* Number of fields */
217
 
  uint32_t rec_buff_length;                 /* Size of table->record[] buffer */
218
 
  uint32_t keys, key_parts;
219
 
  uint32_t max_key_length, max_unique_length, total_key_length;
220
 
  uint32_t uniques;                         /* Number of UNIQUE index */
221
 
  uint32_t null_fields;                 /* number of null fields */
222
 
  uint32_t blob_fields;                 /* number of blob fields */
223
 
  uint32_t timestamp_field_offset;              /* Field number for timestamp field */
224
 
  uint32_t varchar_fields;                  /* number of varchar fields */
225
 
  uint32_t db_create_options;           /* Create options from database */
226
 
  uint32_t db_options_in_use;           /* Options in use */
227
 
  uint32_t db_record_offset;            /* if HA_REC_IN_SEQ */
228
 
  uint32_t rowid_field_offset;          /* Field_nr +1 to rowid field */
229
 
  /* Index of auto-updated TIMESTAMP field in field array */
230
 
  uint32_t primary_key;
231
 
  uint32_t next_number_index;               /* autoincrement key number */
232
 
  uint32_t next_number_key_offset;          /* autoinc keypart offset in a key */
233
 
  uint32_t next_number_keypart;             /* autoinc keypart number in a key */
234
 
  uint32_t error, open_errno, errarg;       /* error from open_table_def() */
235
 
  uint32_t column_bitmap_size;
236
 
  unsigned char frm_version;
237
 
  bool null_field_first;
238
 
  bool db_low_byte_first;               /* Portable row format */
239
 
  bool crashed;
240
 
  bool name_lock, replace_with_name_lock;
241
 
  bool waiting_on_cond;                 /* Protection against free */
242
 
  uint32_t table_map_id;                   /* for row-based replication */
243
 
  uint64_t table_map_version;
244
 
 
245
 
  /*
246
 
    Cache for row-based replication table share checks that does not
247
 
    need to be repeated. Possible values are: -1 when cache value is
248
 
    not calculated yet, 0 when table *shall not* be replicated, 1 when
249
 
    table *may* be replicated.
250
 
  */
251
 
  int cached_row_logging_check;
252
 
 
253
 
  /*
254
 
    Set share's table cache key and update its db and table name appropriately.
255
 
 
256
 
    SYNOPSIS
257
 
      set_table_cache_key()
258
 
        key_buff    Buffer with already built table cache key to be
259
 
                    referenced from share.
260
 
        key_length  Key length.
261
 
 
262
 
    NOTES
263
 
      Since 'key_buff' buffer will be referenced from share it should has same
264
 
      life-time as share itself.
265
 
      This method automatically ensures that TABLE_SHARE::table_name/db have
266
 
      appropriate values by using table cache key as their source.
267
 
  */
268
 
 
269
 
  void set_table_cache_key(char *key_buff, uint32_t key_length)
270
 
  {
271
 
    table_cache_key.str= key_buff;
272
 
    table_cache_key.length= key_length;
273
 
    /*
274
 
      Let us use the fact that the key is "db/0/table_name/0" + optional
275
 
      part for temporary tables.
276
 
    */
277
 
    db.str=            table_cache_key.str;
278
 
    db.length=         strlen(db.str);
279
 
    table_name.str=    db.str + db.length + 1;
280
 
    table_name.length= strlen(table_name.str);
281
 
  }
282
 
 
283
 
 
284
 
  /*
285
 
    Set share's table cache key and update its db and table name appropriately.
286
 
 
287
 
    SYNOPSIS
288
 
      set_table_cache_key()
289
 
        key_buff    Buffer to be used as storage for table cache key
290
 
                    (should be at least key_length bytes).
291
 
        key         Value for table cache key.
292
 
        key_length  Key length.
293
 
 
294
 
    NOTE
295
 
      Since 'key_buff' buffer will be used as storage for table cache key
296
 
      it should has same life-time as share itself.
297
 
  */
298
 
 
299
 
  void set_table_cache_key(char *key_buff, const char *key, uint32_t key_length)
300
 
  {
301
 
    memcpy(key_buff, key, key_length);
302
 
    set_table_cache_key(key_buff, key_length);
303
 
  }
304
 
 
305
 
  inline bool honor_global_locks()
306
 
  {
307
 
    return (table_category == TABLE_CATEGORY_USER);
308
 
  }
309
 
 
310
 
  inline uint32_t get_table_def_version()
311
 
  {
312
 
    return table_map_id;
313
 
  }
314
 
 
315
 
} TABLE_SHARE;
316
 
 
317
56
 
318
57
extern uint32_t refresh_version;
319
58
 
320
 
/* Information for one open table */
321
 
enum index_hint_type
322
 
{
323
 
  INDEX_HINT_IGNORE,
324
 
  INDEX_HINT_USE,
325
 
  INDEX_HINT_FORCE
326
 
};
327
 
 
328
59
typedef struct st_table_field_w_type
329
60
{
330
61
  LEX_STRING name;
332
63
  LEX_STRING cset;
333
64
} TABLE_FIELD_W_TYPE;
334
65
 
335
 
bool create_myisam_from_heap(THD *thd, Table *table,
 
66
bool create_myisam_from_heap(Session *session, Table *table,
336
67
                             MI_COLUMNDEF *start_recinfo,
337
 
                             MI_COLUMNDEF **recinfo, 
 
68
                             MI_COLUMNDEF **recinfo,
338
69
                             int error, bool ignore_last_dupp_key_error);
339
70
 
340
71
class Table {
355
86
  inline uint32_t getNullFields() { return s->null_fields; }
356
87
  inline unsigned char *getDefaultValues() { return s->default_values; }
357
88
 
358
 
  inline bool isNullFieldFirst() { return s->null_field_first; }
359
89
  inline bool isDatabaseLowByteFirst() { return s->db_low_byte_first; }         /* Portable row format */
360
90
  inline bool isCrashed() { return s->crashed; }
361
 
  inline bool isNameLock() { return s->name_lock; } 
 
91
  inline bool isNameLock() { return s->name_lock; }
362
92
  inline bool isReplaceWithNameLock() { return s->replace_with_name_lock; }
363
93
  inline bool isWaitingOnCondition() { return s->waiting_on_cond; }                 /* Protection against free */
364
94
 
365
95
  /* For TMP tables, should be pulled out as a class */
366
96
  void updateCreateInfo(HA_CREATE_INFO *create_info);
367
97
  void setup_tmp_table_column_bitmaps(unsigned char *bitmaps);
368
 
  bool create_myisam_tmp_table(KEY *keyinfo, 
 
98
  bool create_myisam_tmp_table(KEY *keyinfo,
369
99
                               MI_COLUMNDEF *start_recinfo,
370
 
                               MI_COLUMNDEF **recinfo, 
 
100
                               MI_COLUMNDEF **recinfo,
371
101
                               uint64_t options);
372
 
  void free_tmp_table(THD *thd);
 
102
  void free_tmp_table(Session *session);
373
103
  bool open_tmp_table();
374
104
  size_t max_row_length(const unsigned char *data);
375
105
  uint32_t find_shortest_key(const key_map *usable_keys);
381
111
  /* See if this can be blown away */
382
112
  inline uint32_t getDBStat () { return db_stat; }
383
113
  inline uint32_t setDBStat () { return db_stat; }
384
 
  uint          db_stat;                /* mode of file as in handler.h */
 
114
  uint32_t db_stat;             /* mode of file as in handler.h */
385
115
 
386
116
  handler       *file;
387
117
  Table *next, *prev;
388
118
 
389
 
  THD   *in_use;                        /* Which thread uses this */
 
119
  Session       *in_use;                        /* Which thread uses this */
390
120
  Field **field;                        /* Pointer to fields */
391
121
 
392
122
  unsigned char *record[2];                     /* Pointer to records */
393
123
  unsigned char *write_row_record;              /* Used as optimisation in
394
 
                                           THD::write_row */
 
124
                                           Session::write_row */
395
125
  unsigned char *insert_values;                  /* used by INSERT ... UPDATE */
396
 
  /* 
397
 
    Map of keys that can be used to retrieve all data from this table 
 
126
  /*
 
127
    Map of keys that can be used to retrieve all data from this table
398
128
    needed by the query without reading the row.
399
129
  */
400
130
  key_map covering_keys;
403
133
    A set of keys that can be used in the query that references this
404
134
    table.
405
135
 
406
 
    All indexes disabled on the table's TABLE_SHARE (see Table::s) will be 
 
136
    All indexes disabled on the table's TABLE_SHARE (see Table::s) will be
407
137
    subtracted from this set upon instantiation. Thus for any Table t it holds
408
 
    that t.keys_in_use_for_query is a subset of t.s.keys_in_use. Generally we 
 
138
    that t.keys_in_use_for_query is a subset of t.s.keys_in_use. Generally we
409
139
    must not introduce any new keys here (see setup_tables).
410
140
 
411
141
    The set is implemented as a bitmap.
420
150
  Field *next_number_field;             /* Set if next_number is activated */
421
151
  Field *found_next_number_field;       /* Set on open */
422
152
  Field_timestamp *timestamp_field;
 
153
  Field **vfield;                       /* Pointer to virtual fields*/
423
154
 
424
155
  TableList *pos_in_table_list;/* Element referring to this table */
425
156
  order_st *group;
434
165
 
435
166
   Temporary tables:
436
167
 
437
 
   table->query_id is set to thd->query_id for the duration of a statement
 
168
   table->query_id is set to session->query_id for the duration of a statement
438
169
   and is reset to 0 once it is closed by the same statement. A non-zero
439
170
   table->query_id means that a statement is using the table even if it's
440
171
   not the current statement (table is in use by some outer statement).
441
172
 
442
173
   Non-temporary tables:
443
174
 
444
 
   Under pre-locked or LOCK TABLES mode: query_id is set to thd->query_id
 
175
   Under pre-locked or LOCK TABLES mode: query_id is set to session->query_id
445
176
   for the duration of a statement and is reset to 0 once it is closed by
446
177
   the same statement. A non-zero query_id is used to control which tables
447
178
   in the list of pre-opened and locked tables are actually being used.
448
179
  */
449
180
  query_id_t    query_id;
450
181
 
451
 
  /* 
 
182
  /*
452
183
    For each key that has quick_keys.is_set(key) == true: estimate of #records
453
184
    and max #key parts that range access would use.
454
185
  */
460
191
  uint          quick_key_parts[MAX_KEY];
461
192
  uint          quick_n_ranges[MAX_KEY];
462
193
 
463
 
  /* 
 
194
  /*
464
195
    Estimate of number of records that satisfy SARGable part of the table
465
196
    condition, or table->file->records if no SARGable condition could be
466
197
    constructed.
467
198
    This value is used by join optimizer as an estimate of number of records
468
 
    that will pass the table condition (condition that depends on fields of 
 
199
    that will pass the table condition (condition that depends on fields of
469
200
    this table and constants)
470
201
  */
471
202
  ha_rows       quick_condition_rows;
504
235
  bool maybe_null;
505
236
 
506
237
  /*
507
 
    If true, the current table row is considered to have all columns set to 
 
238
    If true, the current table row is considered to have all columns set to
508
239
    NULL, including columns declared as "not null" (see maybe_null).
509
240
  */
510
241
  bool null_row;
561
292
  void mark_columns_needed_for_update(void);
562
293
  void mark_columns_needed_for_delete(void);
563
294
  void mark_columns_needed_for_insert(void);
 
295
  void mark_virtual_columns(void);
564
296
  inline void column_bitmaps_set(MY_BITMAP *read_set_arg,
565
297
                                 MY_BITMAP *write_set_arg)
566
298
  {
599
331
  { return s->version != refresh_version; }
600
332
 
601
333
  int report_error(int error);
 
334
  int closefrm(bool free_share);
 
335
  uint32_t tmpkeyval();
602
336
};
603
337
 
 
338
Table *create_virtual_tmp_table(Session *session,
 
339
                                List<Create_field> &field_list);
 
340
 
604
341
typedef struct st_foreign_key_info
605
342
{
606
343
  LEX_STRING *forein_id;
613
350
  List<LEX_STRING> referenced_fields;
614
351
} FOREIGN_KEY_INFO;
615
352
 
616
 
/*
617
 
  Make sure that the order of schema_tables and enum_schema_tables are the same.
618
 
*/
619
 
 
620
 
enum enum_schema_tables
621
 
{
622
 
  SCH_CHARSETS= 0,
623
 
  SCH_COLLATIONS,
624
 
  SCH_COLLATION_CHARACTER_SET_APPLICABILITY,
625
 
  SCH_COLUMNS,
626
 
  SCH_GLOBAL_STATUS,
627
 
  SCH_GLOBAL_VARIABLES,
628
 
  SCH_KEY_COLUMN_USAGE,
629
 
  SCH_OPEN_TABLES,
630
 
  SCH_PLUGINS,
631
 
  SCH_PROCESSLIST,
632
 
  SCH_REFERENTIAL_CONSTRAINTS,
633
 
  SCH_SCHEMATA,
634
 
  SCH_SESSION_STATUS,
635
 
  SCH_SESSION_VARIABLES,
636
 
  SCH_STATISTICS,
637
 
  SCH_STATUS,
638
 
  SCH_TABLES,
639
 
  SCH_TABLE_CONSTRAINTS,
640
 
  SCH_TABLE_NAMES,
641
 
  SCH_VARIABLES
642
 
};
643
 
 
644
 
 
645
 
#define MY_I_S_MAYBE_NULL 1
646
 
#define MY_I_S_UNSIGNED   2
647
 
 
648
 
 
649
 
#define SKIP_OPEN_TABLE 0                // do not open table
650
 
#define OPEN_FRM_ONLY   1                // open FRM file only
651
 
#define OPEN_FULL_TABLE 2                // open FRM,MYD, MYI files
652
 
 
653
353
typedef struct st_field_info
654
354
{
655
 
  /** 
656
 
      This is used as column name. 
 
355
  /**
 
356
      This is used as column name.
657
357
  */
658
358
  const char* field_name;
659
359
  /**
694
394
  const char* table_name;
695
395
  ST_FIELD_INFO *fields_info;
696
396
  /* Create information_schema table */
697
 
  Table *(*create_table)  (THD *thd, TableList *table_list);
 
397
  Table *(*create_table)  (Session *session, TableList *table_list);
698
398
  /* Fill table with data */
699
 
  int (*fill_table) (THD *thd, TableList *tables, COND *cond);
 
399
  int (*fill_table) (Session *session, TableList *tables, COND *cond);
700
400
  /* Handle fileds for old SHOW */
701
 
  int (*old_format) (THD *thd, struct ST_SCHEMA_TABLE *schema_table);
702
 
  int (*process_table) (THD *thd, TableList *tables, Table *table,
 
401
  int (*old_format) (Session *session, struct ST_SCHEMA_TABLE *schema_table);
 
402
  int (*process_table) (Session *session, TableList *tables, Table *table,
703
403
                        bool res, LEX_STRING *db_name, LEX_STRING *table_name);
704
 
  int idx_field1, idx_field2; 
 
404
  int idx_field1, idx_field2;
705
405
  bool hidden;
706
406
  uint32_t i_s_requested_object;  /* the object we need to open(Table | VIEW) */
707
407
};
712
412
 
713
413
struct st_lex;
714
414
class select_union;
715
 
class TMP_TABLE_PARAM;
716
 
 
717
 
struct Field_translator
718
 
{
719
 
  Item *item;
720
 
  const char *name;
721
 
};
722
 
 
 
415
class Tmp_Table_Param;
723
416
 
724
417
typedef struct st_changed_table_list
725
418
{
737
430
} OPEN_TableList;
738
431
 
739
432
 
 
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
 
740
449
#endif /* DRIZZLED_TABLE_H */