~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/parser.h

This patch completes the first step in the splitting of
the XA resource manager API from the storage engine API,
as outlined in the specification here:

http://drizzle.org/wiki/XaStorageEngine

* Splits plugin::StorageEngine into a base StorageEngine
  class and two derived classes, TransactionalStorageEngine
  and XaStorageEngine.  XaStorageEngine derives from
  TransactionalStorageEngine and creates the XA Resource
  Manager API for storage engines.

  - The methods moved from StorageEngine to TransactionalStorageEngine
    include releaseTemporaryLatches(), startConsistentSnapshot(), 
    commit(), rollback(), setSavepoint(), releaseSavepoint(),
    rollbackToSavepoint() and hasTwoPhaseCommit()
  - The methods moved from StorageEngine to XaStorageEngine
    include recover(), commitXid(), rollbackXid(), and prepare()

* Places all static "EngineVector"s into their proper
  namespaces (typedefs belong in header files, not implementation files)
  and places all static methods corresponding
  to either only transactional engines or only XA engines
  into their respective files in /drizzled/plugin/

* Modifies the InnoDB "handler" files to extend plugin::XaStorageEngine
  and not plugin::StorageEngine

The next step, as outlined in the wiki spec page above, is to isolate
the XA Resource Manager API into its own plugin class and modify
plugin::XaStorageEngine to implement plugin::XaResourceManager via
composition.  This is necessary to enable building plugins which can
participate in an XA transaction *without having to have that plugin
implement the entire storage engine API*

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2000-2003 MySQL AB
2
 
 
3
 
   This program is free software; you can redistribute it and/or modify
4
 
   it under the terms of the GNU General Public License as published by
5
 
   the Free Software Foundation; version 2 of the License.
6
 
 
7
 
   This program is distributed in the hope that it will be useful,
8
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 
   GNU General Public License for more details.
11
 
 
12
 
   You should have received a copy of the GNU General Public License
13
 
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
15
 
 
16
 
#ifndef DRIZZLED_PARSER_H
17
 
#define DRIZZLED_PARSER_H
18
 
 
19
 
#include <drizzled/charset.h>
20
 
#include <drizzled/error.h>
21
 
#include <drizzled/foreign_key.h>
22
 
#include <drizzled/function/get_system_var.h>
23
 
#include <drizzled/function/locate.h>
24
 
#include <drizzled/function/set_user_var.h>
25
 
#include <drizzled/function/str/char.h>
26
 
#include <drizzled/function/str/collation.h>
27
 
#include <drizzled/function/str/insert.h>
28
 
#include <drizzled/function/str/left.h>
29
 
#include <drizzled/function/str/repeat.h>
30
 
#include <drizzled/function/str/replace.h>
31
 
#include <drizzled/function/str/right.h>
32
 
#include <drizzled/function/str/set_collation.h>
33
 
#include <drizzled/function/str/trim.h>
34
 
#include <drizzled/function/time/curdate.h>
35
 
#include <drizzled/function/time/date_add_interval.h>
36
 
#include <drizzled/function/time/dayofmonth.h>
37
 
#include <drizzled/function/time/extract.h>
38
 
#include <drizzled/function/time/hour.h>
39
 
#include <drizzled/function/time/microsecond.h>
40
 
#include <drizzled/function/time/minute.h>
41
 
#include <drizzled/function/time/month.h>
42
 
#include <drizzled/function/time/now.h>
43
 
#include <drizzled/function/time/quarter.h>
44
 
#include <drizzled/function/time/second.h>
45
 
#include <drizzled/function/time/sysdate_local.h>
46
 
#include <drizzled/function/time/timestamp_diff.h>
47
 
#include <drizzled/function/time/typecast.h>
48
 
#include <drizzled/function/time/year.h>
49
 
#include <drizzled/global_charset_info.h>
50
 
#include <drizzled/internal/m_string.h>
51
 
#include <drizzled/item/boolean.h>
52
 
#include <drizzled/item/cmpfunc.h>
53
 
#include <drizzled/item/copy_string.h>
54
 
#include <drizzled/item/create.h>
55
 
#include <drizzled/item/default_value.h>
56
 
#include <drizzled/item/func.h>
57
 
#include <drizzled/item/insert_value.h>
58
 
#include <drizzled/item/null.h>
59
 
#include <drizzled/item/uint.h>
60
 
#include <drizzled/lex_string.h>
61
 
#include <drizzled/lex_symbol.h>
62
 
#include <drizzled/message/schema.pb.h>
63
 
#include <drizzled/message/table.pb.h>
64
 
#include <drizzled/nested_join.h>
65
 
#include <drizzled/pthread_globals.h>
66
 
#include <drizzled/select_dump.h>
67
 
#include <drizzled/select_dumpvar.h>
68
 
#include <drizzled/select_export.h>
69
 
#include <drizzled/session.h>
70
 
#include <drizzled/sql_base.h>
71
 
#include <drizzled/sql_parse.h>
72
 
#include <drizzled/statement.h>
73
 
#include <drizzled/statement/alter_schema.h>
74
 
#include <drizzled/statement/alter_table.h>
75
 
#include <drizzled/statement/analyze.h>
76
 
#include <drizzled/statement/catalog.h>
77
 
#include <drizzled/statement/change_schema.h>
78
 
#include <drizzled/statement/check.h>
79
 
#include <drizzled/statement/commit.h>
80
 
#include <drizzled/statement/create_index.h>
81
 
#include <drizzled/statement/create_schema.h>
82
 
#include <drizzled/statement/create_table.h>
83
 
#include <drizzled/statement/create_table/like.h>
84
 
#include <drizzled/statement/create_table/select.h>
85
 
#include <drizzled/statement/delete.h>
86
 
#include <drizzled/statement/drop_index.h>
87
 
#include <drizzled/statement/drop_schema.h>
88
 
#include <drizzled/statement/drop_table.h>
89
 
#include <drizzled/statement/empty_query.h>
90
 
#include <drizzled/statement/execute.h>
91
 
#include <drizzled/statement/flush.h>
92
 
#include <drizzled/statement/insert.h>
93
 
#include <drizzled/statement/insert_select.h>
94
 
#include <drizzled/statement/kill.h>
95
 
#include <drizzled/statement/load.h>
96
 
#include <drizzled/statement/release_savepoint.h>
97
 
#include <drizzled/statement/rename_table.h>
98
 
#include <drizzled/statement/replace.h>
99
 
#include <drizzled/statement/replace_select.h>
100
 
#include <drizzled/statement/rollback.h>
101
 
#include <drizzled/statement/rollback_to_savepoint.h>
102
 
#include <drizzled/statement/savepoint.h>
103
 
#include <drizzled/statement/select.h>
104
 
#include <drizzled/statement/set_option.h>
105
 
#include <drizzled/statement/show.h>
106
 
#include <drizzled/statement/show_errors.h>
107
 
#include <drizzled/statement/show_warnings.h>
108
 
#include <drizzled/statement/start_transaction.h>
109
 
#include <drizzled/statement/truncate.h>
110
 
#include <drizzled/statement/unlock_tables.h>
111
 
#include <drizzled/statement/update.h>
112
 
 
113
 
namespace drizzled {
114
 
 
115
 
class Session;
116
 
class Table_ident;
117
 
class Item;
118
 
class Item_num;
119
 
 
120
 
namespace item
121
 
{
122
 
class Boolean;
123
 
class True;
124
 
class False;
125
 
}
126
 
 
127
 
namespace parser {
128
 
 
129
 
Item* handle_sql2003_note184_exception(Session *session, Item* left, bool equal, Item *expr);
130
 
bool add_select_to_union_list(Session *session, LEX *lex, bool is_union_distinct);
131
 
bool setup_select_in_parentheses(Session *session, LEX *lex);
132
 
Item* reserved_keyword_function(Session *session, const std::string &name, List<Item> *item_list);
133
 
void my_parse_error(Lex_input_stream *lip);
134
 
void my_parse_error(const char *message);
135
 
bool check_reserved_words(LEX_STRING *name);
136
 
void errorOn(drizzled::Session *session, const char *s);
137
 
 
138
 
 
139
 
bool buildOrderBy(LEX *lex);
140
 
void buildEngineOption(LEX *lex, const char *key, const LEX_STRING &value);
141
 
void buildEngineOption(LEX *lex, const char *key, uint64_t value);
142
 
void buildSchemaOption(LEX *lex, const char *key, const LEX_STRING &value);
143
 
void buildSchemaOption(LEX *lex, const char *key, uint64_t value);
144
 
bool checkFieldIdent(LEX *lex, const LEX_STRING &schema_name, const LEX_STRING &table_name);
145
 
 
146
 
Item *buildIdent(LEX *lex, const LEX_STRING &schema_name, const LEX_STRING &table_name, const LEX_STRING &field_name);
147
 
Item *buildTableWild(LEX *lex, const LEX_STRING &schema_name, const LEX_STRING &table_name);
148
 
 
149
 
void buildCreateFieldIdent(LEX *lex);
150
 
 
151
 
void storeAlterColumnPosition(LEX *lex, const char *position);
152
 
 
153
 
bool buildCollation(LEX *lex, const CHARSET_INFO *arg);
154
 
void buildKey(LEX *lex, Key::Keytype type_par, const lex_string_t &name_arg);
155
 
void buildForeignKey(LEX *lex, const lex_string_t &name_arg, drizzled::Table_ident *table);
156
 
 
157
 
drizzled::enum_field_types buildIntegerColumn(LEX *lex, drizzled::enum_field_types final_type, const bool is_unsigned);
158
 
drizzled::enum_field_types buildSerialColumn(LEX *lex);
159
 
drizzled::enum_field_types buildVarcharColumn(LEX *lex, const char *length);
160
 
drizzled::enum_field_types buildVarbinaryColumn(LEX *lex, const char *length);
161
 
drizzled::enum_field_types buildBlobColumn(LEX *lex);
162
 
drizzled::enum_field_types buildBooleanColumn(LEX *lex);
163
 
drizzled::enum_field_types buildUuidColumn(LEX *lex);
164
 
drizzled::enum_field_types buildDoubleColumn(LEX *lex);
165
 
drizzled::enum_field_types buildTimestampColumn(LEX *lex, const char *length);
166
 
drizzled::enum_field_types buildDecimalColumn(LEX *lex);
167
 
 
168
 
void buildKeyOnColumn(LEX *lex);
169
 
void buildAutoOnColumn(LEX *lex);
170
 
void buildPrimaryOnColumn(LEX *lex);
171
 
void buildReplicationOption(LEX *lex, bool arg);
172
 
void buildAddAlterDropIndex(LEX *lex, const char *name, bool is_foreign_key= false);
173
 
 
174
 
} // namespace parser
175
 
} // namespace drizzled
176
 
 
177
 
#endif /* DRIZZLED_PARSER_H */