~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table.h

  • Committer: Monty Taylor
  • Date: 2008-11-17 07:23:53 UTC
  • mto: (589.1.3 devel)
  • mto: This revision was merged to the branch mainline in revision 589.
  • Revision ID: monty@inaugust.com-20081117072353-tc8ykdsycno0cc5u
Split out a little more code. Removed table_list.h from common_includes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include <drizzled/handler.h>
33
33
#include <drizzled/lex_string.h>
34
34
 
35
 
class Item;                             /* Needed by order_st */
 
35
class Item;
36
36
class Item_subselect;
37
37
class st_select_lex_unit;
38
38
class st_select_lex;
42
42
 
43
43
/*************************************************************************/
44
44
 
45
 
enum tmp_table_type
46
 
{
47
 
  NO_TMP_TABLE, NON_TRANSACTIONAL_TMP_TABLE, TRANSACTIONAL_TMP_TABLE,
48
 
  INTERNAL_TMP_TABLE, SYSTEM_TMP_TABLE, TMP_TABLE_FRM_FILE_ONLY
49
 
};
50
45
 
51
46
bool mysql_frm_type(Session *session, char *path, enum legacy_db_type *dbt);
52
47
 
53
48
 
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
 
 
72
49
class Field_timestamp;
73
50
class Field_blob;
74
51
 
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
52
typedef enum enum_table_category TABLE_CATEGORY;
131
53
 
132
54
TABLE_CATEGORY get_table_category(const LEX_STRING *db,
322
244
 
323
245
extern uint32_t refresh_version;
324
246
 
325
 
/* Information for one open table */
326
 
enum index_hint_type
327
 
{
328
 
  INDEX_HINT_IGNORE,
329
 
  INDEX_HINT_USE,
330
 
  INDEX_HINT_FORCE
331
 
};
332
 
 
333
247
typedef struct st_table_field_w_type
334
248
{
335
249
  LEX_STRING name;