~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_base.h

Extracted the LOAD command into its own class and implementation files.
Removed the corresponding case label from the switch statement.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
/* sql_base.cc */
37
37
void set_item_name(Item *item,char *pos,uint32_t length);
38
38
bool add_field_to_list(Session *session, LEX_STRING *field_name, enum enum_field_types type,
39
 
                       char *length, char *decimal,
40
 
                       uint32_t type_modifier,
41
 
                       enum column_format_type column_format,
42
 
                       Item *default_value, Item *on_update_value,
43
 
                       LEX_STRING *comment,
44
 
                       char *change, List<String> *interval_list,
45
 
                       const CHARSET_INFO * const cs);
 
39
                       char *length, char *decimal,
 
40
                       uint32_t type_modifier,
 
41
           enum column_format_type column_format,
 
42
                       Item *default_value, Item *on_update_value,
 
43
                       LEX_STRING *comment,
 
44
                       char *change, List<String> *interval_list,
 
45
                       const CHARSET_INFO * const cs);
46
46
CreateField * new_create_field(Session *session, char *field_name, enum_field_types type,
47
 
                               char *length, char *decimals,
48
 
                               uint32_t type_modifier,
49
 
                               Item *default_value, Item *on_update_value,
50
 
                               LEX_STRING *comment, char *change,
51
 
                               List<String> *interval_list, CHARSET_INFO *cs);
 
47
                                char *length, char *decimals,
 
48
                                uint32_t type_modifier,
 
49
                                Item *default_value, Item *on_update_value,
 
50
                                LEX_STRING *comment, char *change,
 
51
                                List<String> *interval_list, CHARSET_INFO *cs);
52
52
void store_position_for_column(const char *name);
 
53
bool add_to_list(Session *session, SQL_LIST &list,Item *group,bool asc);
53
54
bool push_new_name_resolution_context(Session *session,
54
55
                                      TableList *left_op,
55
56
                                      TableList *right_op);
56
57
void add_join_on(TableList *b,Item *expr);
57
58
void add_join_natural(TableList *a,TableList *b,List<String> *using_fields,
58
59
                      Select_Lex *lex);
 
60
void unlink_open_table(Session *session, Table *find);
 
61
void drop_open_table(Session *session, Table *table, const char *db_name,
 
62
                     const char *table_name);
59
63
 
60
64
SQL_SELECT *make_select(Table *head, table_map const_tables,
61
65
                        table_map read_tables, COND *conds,
97
101
bool get_key_map_from_key_list(key_map *map, Table *table,
98
102
                               List<String> *index_list);
99
103
bool insert_fields(Session *session, Name_resolution_context *context,
100
 
                   const char *db_name, const char *table_name,
 
104
                   const char *db_name, const char *table_name,
101
105
                   List_iterator<Item> *it, bool any_privileges);
102
106
bool setup_tables(Session *session, Name_resolution_context *context,
103
107
                  List<TableList> *from_clause, TableList *tables,
126
130
  return res;
127
131
}
128
132
int setup_conds(Session *session, TableList *leaves, COND **conds);
 
133
int setup_ftfuncs(Select_Lex* select);
 
134
int init_ftfuncs(Session *session, Select_Lex* select, bool no_order);
 
135
void wait_for_condition(Session *session, pthread_mutex_t *mutex,
 
136
                        pthread_cond_t *cond);
 
137
int open_tables_from_list(Session *session, TableList **tables, uint32_t *counter, uint32_t flags);
129
138
/* open_and_lock_tables with optional derived handling */
 
139
int open_and_lock_tables_derived(Session *session, TableList *tables, bool derived);
 
140
bool open_normal_and_derived_tables(Session *session, TableList *tables, uint32_t flags);
 
141
int lock_tables(Session *session, TableList *tables, uint32_t counter, bool *need_reopen);
 
142
int decide_logging_format(Session *session);
 
143
Table *open_temporary_table(Session *session, const char *path, const char *db,
 
144
                            const char *table_name, bool link_in_list,
 
145
                            open_table_mode open_mode);
 
146
bool rm_temporary_table(StorageEngine *base, char *path);
 
147
void free_io_cache(Table *entry);
 
148
void intern_close_table(Table *entry);
 
149
void close_temporary_tables(Session *session);
 
150
void close_tables_for_reopen(Session *session, TableList **tables);
130
151
TableList *find_table_in_list(TableList *table,
131
152
                               TableList *TableList::*link,
132
153
                               const char *db_name,
133
154
                               const char *table_name);
134
155
TableList *unique_table(Session *session, TableList *table, TableList *table_list,
135
156
                         bool check_alias);
 
157
Table *find_temporary_table(Session *session, const char *db, const char *table_name);
 
158
Table *find_temporary_table(Session *session, TableList *table_list);
 
159
int drop_temporary_table(Session *session, TableList *table_list);
 
160
void close_temporary_table(Session *session, Table *table, bool free_share,
 
161
                           bool delete_table);
 
162
void close_temporary(Table *table, bool free_share, bool delete_table);
 
163
bool rename_temporary_table(Table *table, const char *new_db, const char *table_name);
136
164
void remove_db_from_cache(const char *db);
137
165
bool is_equal(const LEX_STRING *a, const LEX_STRING *b);
138
166
 
155
183
#define WFRM_PACK_FRM 4
156
184
#define WFRM_KEEP_SHARE 8
157
185
 
158
 
bool fill_record(Session* session, List<Item> &fields, List<Item> &values, bool ignore_errors);
 
186
bool close_cached_tables(Session *session, TableList *tables,
 
187
                         bool wait_for_refresh, bool wait_for_placeholders);
 
188
void copy_field_from_tmp_record(Field *field,int offset);
 
189
bool fill_record(Session * session, List<Item> &fields, List<Item> &values, bool ignore_errors);
159
190
bool fill_record(Session *session, Field **field, List<Item> &values, bool ignore_errors);
160
191
bool list_open_tables(const char *db, const char *wild, bool(*func)(Table *table, open_table_list_st& open_list), Table *display);
161
192
 
166
197
  return find_table_in_list(table, &TableList::next_global,
167
198
                            db_name, table_name);
168
199
}
 
200
 
 
201
inline TableList *find_table_in_local_list(TableList *table,
 
202
                                            const char *db_name,
 
203
                                            const char *table_name)
 
204
{
 
205
  return find_table_in_list(table, &TableList::next_local,
 
206
                            db_name, table_name);
 
207
}
169
208
#endif /* DRIZZLED_SQL_BASE_H */