~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table.h

  • Committer: Monty Taylor
  • Date: 2008-10-22 01:52:54 UTC
  • Revision ID: monty@inaugust.com-20081022015254-65qfk9f2v0b8jlk3
Moved drizzle_com to drizzled/drizzle_common. Started splitting it up.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
  INTERNAL_TMP_TABLE, SYSTEM_TMP_TABLE, TMP_TABLE_FRM_FILE_ONLY
47
47
};
48
48
 
49
 
bool mysql_frm_type(THD *thd, char *path, enum legacy_db_type *dbt);
 
49
bool mysql_frm_type(Session *session, char *path, enum legacy_db_type *dbt);
50
50
 
51
51
 
52
52
enum release_type { RELEASE_NORMAL, RELEASE_WAIT_FOR_DROP };
196
196
  uint32_t   version, mysql_version;
197
197
  uint32_t   timestamp_offset;          /* Set to offset+1 of record */
198
198
  uint32_t   reclength;                 /* Recordlength */
 
199
  uint32_t   stored_rec_length;         /* Stored record length 
 
200
                                           (no generated-only virtual fields) */
199
201
 
200
202
  plugin_ref db_plugin;                 /* storage engine plugin */
201
203
  inline handlerton *db_type() const    /* table_type for handler */
208
210
  enum ha_choice transactional;
209
211
  enum ha_choice page_checksum;
210
212
 
211
 
  uint32_t ref_count;                       /* How many Table objects uses this */
 
213
  uint32_t ref_count;       /* How many Table objects uses this */
212
214
  uint32_t open_count;                  /* Number of tables in open list */
213
215
  uint32_t blob_ptr_size;                       /* 4 or 8 */
214
216
  uint32_t key_block_size;                      /* create key_block_size, if used */
215
217
  uint32_t null_bytes, last_null_bit_pos;
216
218
  uint32_t fields;                              /* Number of fields */
 
219
  uint32_t stored_fields;                   /* Number of stored fields 
 
220
                                           (i.e. without generated-only ones) */
217
221
  uint32_t rec_buff_length;                 /* Size of table->record[] buffer */
218
222
  uint32_t keys, key_parts;
219
223
  uint32_t max_key_length, max_unique_length, total_key_length;
234
238
  uint32_t error, open_errno, errarg;       /* error from open_table_def() */
235
239
  uint32_t column_bitmap_size;
236
240
  unsigned char frm_version;
 
241
  uint32_t vfields;                         /* Number of virtual fields */
237
242
  bool null_field_first;
238
243
  bool db_low_byte_first;               /* Portable row format */
239
244
  bool crashed;
332
337
  LEX_STRING cset;
333
338
} TABLE_FIELD_W_TYPE;
334
339
 
335
 
bool create_myisam_from_heap(THD *thd, Table *table,
 
340
bool create_myisam_from_heap(Session *session, Table *table,
336
341
                             MI_COLUMNDEF *start_recinfo,
337
342
                             MI_COLUMNDEF **recinfo, 
338
343
                             int error, bool ignore_last_dupp_key_error);
369
374
                               MI_COLUMNDEF *start_recinfo,
370
375
                               MI_COLUMNDEF **recinfo, 
371
376
                               uint64_t options);
372
 
  void free_tmp_table(THD *thd);
 
377
  void free_tmp_table(Session *session);
373
378
  bool open_tmp_table();
374
379
  size_t max_row_length(const unsigned char *data);
375
380
  uint32_t find_shortest_key(const key_map *usable_keys);
386
391
  handler       *file;
387
392
  Table *next, *prev;
388
393
 
389
 
  THD   *in_use;                        /* Which thread uses this */
 
394
  Session       *in_use;                        /* Which thread uses this */
390
395
  Field **field;                        /* Pointer to fields */
391
396
 
392
397
  unsigned char *record[2];                     /* Pointer to records */
393
398
  unsigned char *write_row_record;              /* Used as optimisation in
394
 
                                           THD::write_row */
 
399
                                           Session::write_row */
395
400
  unsigned char *insert_values;                  /* used by INSERT ... UPDATE */
396
401
  /* 
397
402
    Map of keys that can be used to retrieve all data from this table 
420
425
  Field *next_number_field;             /* Set if next_number is activated */
421
426
  Field *found_next_number_field;       /* Set on open */
422
427
  Field_timestamp *timestamp_field;
 
428
  Field **vfield;                       /* Pointer to virtual fields*/
423
429
 
424
430
  TableList *pos_in_table_list;/* Element referring to this table */
425
431
  order_st *group;
434
440
 
435
441
   Temporary tables:
436
442
 
437
 
   table->query_id is set to thd->query_id for the duration of a statement
 
443
   table->query_id is set to session->query_id for the duration of a statement
438
444
   and is reset to 0 once it is closed by the same statement. A non-zero
439
445
   table->query_id means that a statement is using the table even if it's
440
446
   not the current statement (table is in use by some outer statement).
441
447
 
442
448
   Non-temporary tables:
443
449
 
444
 
   Under pre-locked or LOCK TABLES mode: query_id is set to thd->query_id
 
450
   Under pre-locked or LOCK TABLES mode: query_id is set to session->query_id
445
451
   for the duration of a statement and is reset to 0 once it is closed by
446
452
   the same statement. A non-zero query_id is used to control which tables
447
453
   in the list of pre-opened and locked tables are actually being used.
561
567
  void mark_columns_needed_for_update(void);
562
568
  void mark_columns_needed_for_delete(void);
563
569
  void mark_columns_needed_for_insert(void);
 
570
  void mark_virtual_columns(void);
564
571
  inline void column_bitmaps_set(MY_BITMAP *read_set_arg,
565
572
                                 MY_BITMAP *write_set_arg)
566
573
  {
694
701
  const char* table_name;
695
702
  ST_FIELD_INFO *fields_info;
696
703
  /* Create information_schema table */
697
 
  Table *(*create_table)  (THD *thd, TableList *table_list);
 
704
  Table *(*create_table)  (Session *session, TableList *table_list);
698
705
  /* Fill table with data */
699
 
  int (*fill_table) (THD *thd, TableList *tables, COND *cond);
 
706
  int (*fill_table) (Session *session, TableList *tables, COND *cond);
700
707
  /* 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,
 
708
  int (*old_format) (Session *session, struct ST_SCHEMA_TABLE *schema_table);
 
709
  int (*process_table) (Session *session, TableList *tables, Table *table,
703
710
                        bool res, LEX_STRING *db_name, LEX_STRING *table_name);
704
711
  int idx_field1, idx_field2; 
705
712
  bool hidden;