~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/common_includes.h

  • Committer: Monty Taylor
  • Date: 2008-10-23 23:53:49 UTC
  • mto: This revision was merged to the branch mainline in revision 557.
  • Revision ID: monty@inaugust.com-20081023235349-317wgwqwgccuacmq
SplitĀ outĀ nested_join.h.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
/* Cross-platform portability code and standard includes */
40
40
#include <drizzled/global.h>                    
41
 
/* Server versioning information and defines */
42
 
#include <drizzled/version.h>                   
43
41
/* Lots of system-wide struct definitions like IO_CACHE, prototypes for all my_* functions */
44
42
#include <mysys/my_sys.h>                       
45
43
/* Convenience functions for working with times */
52
50
#include <signal.h>
53
51
/* Deadlock-free table-list lock API */
54
52
#include <mysys/thr_lock.h>
55
 
/* Custom error API */
56
 
#include <drizzled/error.h>
57
53
/* Defines for the storage engine handler -- i.e. HA_XXX defines */
58
54
#include <drizzled/base.h>                                      /* Needed by field.h */
59
55
/* Custom queue API */
69
65
/* Network database operations (hostent, netent, servent, etc...*/
70
66
#include <netdb.h>
71
67
/* Definitions that the client and the server have in common */
72
 
#include <libdrizzle/drizzle_com.h>
73
 
/* gettext() convenience wrappers */
74
 
#include <libdrizzle/gettext.h>
 
68
#include <drizzled/common.h>
75
69
/* Contains system-wide constants and #defines */
76
70
#include <drizzled/definitions.h>
77
71
/* System-wide common data structures */
78
72
#include <drizzled/structs.h>
79
 
/* Custom error definitions */
80
 
#include <drizzled/error.h>
81
73
/* Custom continguous-section memory allocator */
82
74
#include <drizzled/sql_alloc.h>
83
75
/* Definition of the MY_LOCALE struct and some convenience functions */
84
76
#include <drizzled/sql_locale.h>
85
77
 
 
78
#include <drizzled/korr.h>
 
79
 
86
80
#ifdef HAVE_DTRACE
87
81
#define _DTRACE_VERSION 1
88
82
#else
117
111
  QT_IS
118
112
};
119
113
 
120
 
/** 
121
 
 * @TODO convert all these three maps to Bitmap classes 
122
 
 *
123
 
 * @TODO Move these to a more appropriate header file (maps.h?).  The following files use them:
124
 
 *
125
 
 *    item_sum.h
126
 
 *    item_compfunc.h
127
 
 *    item.h
128
 
 *    table.h
129
 
 *    item_subselect.h
130
 
 *    sql_bitmap.h
131
 
 *    unireg.h (going bye bye?)
132
 
 *    sql_udf.h
133
 
 *    item_row.h
134
 
 *    handler.cc
135
 
 *    sql_insert.cc
136
 
 *    opt_range.h
137
 
 *    opt_sum.cc
138
 
 *    item_strfunc.h
139
 
 *    sql_delete.cc
140
 
 *    sql_select.h
141
 
 *
142
 
 *    Since most of these include table.h, I think that would appropriate...
143
 
 */
144
 
typedef uint64_t table_map;          /* Used for table bits in join */
145
 
#if MAX_INDEXES <= 64
146
 
typedef Bitmap<64>  key_map;          /* Used for finding keys */
147
 
#else
148
 
typedef Bitmap<((MAX_INDEXES+7)/8*8)> key_map; /* Used for finding keys */
149
 
#endif
150
 
typedef uint32_t nesting_map;  /* Used for flags of nesting constructs */
151
 
 
152
 
/*
153
 
  Used to identify NESTED_JOIN structures within a join (applicable only to
154
 
  structures that have not been simplified away and embed more the one
155
 
  element)
156
 
*/
157
 
typedef uint64_t nested_join_map; /* Needed by sql_select.h and table.h */
158
 
 
159
 
/* useful constants */#
160
 
extern const key_map key_map_empty;
161
 
extern key_map key_map_full;          /* Should be threaded as const */
162
 
extern const char *primary_key_name;
163
114
 
164
115
/**
165
116
 * @TODO Move the following into a drizzled.h header?
168
119
 * and that are used only in the server should be separated out into 
169
120
 * a drizzled.h header file -- JRP
170
121
 */
171
 
typedef uint64_t query_id_t;
172
122
extern query_id_t global_query_id;
173
123
 
174
124
/* increment query_id and return it.  */
251
201
class TableList;
252
202
class String;
253
203
class Table;
254
 
class THD;
 
204
class Session;
255
205
class user_var_entry;
256
206
class Security_context;
257
207
 
258
 
#define thd_proc_info(thd, msg)  set_thd_proc_info(thd, msg, __func__, __FILE__, __LINE__)
259
 
 
260
 
extern pthread_key(THD*, THR_THD);
261
 
inline THD *_current_thd(void)
 
208
extern pthread_key(Session*, THR_Session);
 
209
inline Session *_current_session(void)
262
210
{
263
 
  return (THD *)pthread_getspecific(THR_THD);
 
211
  return (Session *)pthread_getspecific(THR_Session);
264
212
}
265
 
#define current_thd _current_thd()
 
213
#define current_session _current_session()
266
214
 
267
 
/** 
268
 
  The meat of thd_proc_info(THD*, char*), a macro that packs the last
269
 
  three calling-info parameters. 
270
 
*/
271
 
extern "C"
272
 
const char *set_thd_proc_info(THD *thd, const char *info, 
273
 
                              const char *calling_func, 
274
 
                              const char *calling_file, 
275
 
                              const unsigned int calling_line);
 
215
extern "C" void set_session_proc_info(Session *session, const char *info);
 
216
extern "C" const char *get_session_proc_info(Session *session);
276
217
 
277
218
/*
278
219
  External variables
295
236
extern my_decimal decimal_zero;
296
237
 
297
238
/** @TODO Find a good header to put this guy... */
298
 
void close_thread_tables(THD *thd);
 
239
void close_thread_tables(Session *session);
299
240
 
300
241
#include <drizzled/sql_parse.h>
301
242
 
317
258
 * InnoDB?  Or does the InnoDB plugin already fix this stuff?
318
259
 */
319
260
#if defined DRIZZLE_SERVER || defined INNODB_COMPATIBILITY_HOOKS
320
 
bool check_global_access(THD *thd, ulong want_access);
321
 
int get_quote_char_for_identifier(THD *thd, const char *name, uint32_t length);
 
261
bool check_global_access(Session *session, ulong want_access);
 
262
int get_quote_char_for_identifier(Session *session, const char *name, uint32_t length);
322
263
extern struct system_variables global_system_variables;
323
264
extern uint32_t mysql_data_home_len;
324
265
extern char *mysql_data_home,server_version[SERVER_VERSION_LENGTH],