~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_base.h

  • Committer: Brian Aker
  • Date: 2010-01-22 00:53:13 UTC
  • Revision ID: brian@gaz-20100122005313-jmizcbcdi1lt4tcx
Revert db patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
 
21
 
 
22
20
#ifndef DRIZZLED_SQL_BASE_H
23
21
#define DRIZZLED_SQL_BASE_H
24
22
 
 
23
#include <stdint.h>
25
24
#include <drizzled/table.h>
26
 
#include <drizzled/table_list.h>
27
 
#include <drizzled/table/concurrent.h>
28
 
 
29
 
#include <drizzled/visibility.h>
30
 
 
31
 
namespace drizzled
32
 
{
 
25
 
33
26
class TableShare;
34
27
class Name_resolution_context;
35
28
 
36
29
void table_cache_free(void);
37
30
bool table_cache_init(void);
 
31
void assign_new_table_id(TableShare *share);
38
32
uint32_t cached_open_tables(void);
39
33
uint32_t cached_table_definitions(void);
40
34
 
41
 
table::Cache &get_open_cache();
42
 
 
43
 
DRIZZLED_API void kill_drizzle(void);
 
35
void kill_drizzle(void);
44
36
 
45
37
/* sql_base.cc */
46
38
void set_item_name(Item *item,char *pos,uint32_t length);
58
50
                               Item *default_value, Item *on_update_value,
59
51
                               LEX_STRING *comment, char *change,
60
52
                               List<String> *interval_list, CHARSET_INFO *cs);
 
53
void store_position_for_column(const char *name);
61
54
bool push_new_name_resolution_context(Session *session,
62
55
                                      TableList *left_op,
63
56
                                      TableList *right_op);
95
88
  RESOLVED_WITH_NO_ALIAS,
96
89
  RESOLVED_AGAINST_ALIAS
97
90
};
98
 
Item ** find_item_in_list(Session *session,
99
 
                          Item *item, List<Item> &items, uint32_t *counter,
 
91
Item ** find_item_in_list(Item *item, List<Item> &items, uint32_t *counter,
100
92
                          find_item_error_report_type report_error,
101
93
                          enum_resolution_type *resolution);
102
94
bool insert_fields(Session *session, Name_resolution_context *context,
103
95
                   const char *db_name, const char *table_name,
104
 
                   List<Item>::iterator *it, bool any_privileges);
 
96
                   List_iterator<Item> *it, bool any_privileges);
105
97
bool setup_tables(Session *session, Name_resolution_context *context,
106
98
                  List<TableList> *from_clause, TableList *tables,
107
99
                  TableList **leaves, bool select_insert);
136
128
                               const char *table_name);
137
129
TableList *unique_table(TableList *table, TableList *table_list,
138
130
                        bool check_alias= false);
 
131
void remove_db_from_cache(const char *db);
139
132
 
140
 
/* bits for last argument to table::Cache::singleton().removeTable() */
 
133
/* bits for last argument to remove_table_from_cache() */
141
134
#define RTFC_NO_FLAG                0x0000
142
135
#define RTFC_OWNED_BY_Session_FLAG      0x0001
143
136
#define RTFC_WAIT_OTHER_THREAD_FLAG 0x0002
144
137
#define RTFC_CHECK_KILLED_FLAG      0x0004
 
138
bool remove_table_from_cache(Session *session, const char *db, const char *table,
 
139
                             uint32_t flags);
145
140
 
146
141
void mem_alloc_error(size_t size);
147
142
 
148
143
bool fill_record(Session* session, List<Item> &fields, List<Item> &values, bool ignore_errors= false);
149
144
bool fill_record(Session *session, Field **field, List<Item> &values, bool ignore_errors= false);
 
145
bool list_open_tables(const char *db,
 
146
                      const char *wild,
 
147
                      bool(*func)(Table *table,
 
148
                                  open_table_list_st& open_list,
 
149
                                  drizzled::plugin::InfoSchemaTable *schema_table),
 
150
                      Table *display,
 
151
                      drizzled::plugin::InfoSchemaTable *schema_table);
 
152
 
150
153
inline TableList *find_table_in_global_list(TableList *table,
151
154
                                             const char *db_name,
152
155
                                             const char *table_name)
154
157
  return find_table_in_list(table, &TableList::next_global,
155
158
                            db_name, table_name);
156
159
}
157
 
 
158
 
bool drizzle_rm_tmp_tables();
159
 
 
160
 
} /* namespace drizzled */
161
 
 
162
160
#endif /* DRIZZLED_SQL_BASE_H */