~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/mysql_priv.h

  • Committer: Jay Pipes
  • Date: 2008-08-05 18:43:30 UTC
  • mto: (264.1.6 codestyle)
  • mto: This revision was merged to the branch mainline in revision 266.
  • Revision ID: jay@mysql.com-20080805184330-rooly59ksmwg0wnf
* Added include guards in a couple places, and removed unecessary
  conditional includes in older storage engine code
* Provided comments for included file in mysql_priv.h explaining 
  what each file brought into the include stream
* Added notes and TODOs where cleanup is still needed
* Removed unnecessary pragmas in similarly-named header/implementation
  files (C++ standard says they are unnecessary if implementation is 
  in a file named same as the header.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
  mysqlbinlog too (definition of SELECT_DISTINCT and others).
22
22
  The consequence is that 90% of the file is wrapped in \#ifndef MYSQL_CLIENT,
23
23
  except the part which must be in the server and in the client.
 
24
 
 
25
  @TODO Name this file better. "priv" could mean private, privileged, privileges.
 
26
 
 
27
  @TODO Get rid of the MYSQL_CLIENT and MYSQL_SERVER conditionals
24
28
*/
25
29
 
26
30
#ifndef DRIZZLE_SERVER_MYSQL_PRIV_H
28
32
 
29
33
#ifndef MYSQL_CLIENT
30
34
 
31
 
#include <drizzled/global.h>
32
 
#include <drizzled/version.h>
33
 
#include <mysys/my_sys.h>
 
35
/* Cross-platform portability code and standard includes */
 
36
#include <drizzled/global.h>                    
 
37
/* Server versioning information and defines */
 
38
#include <drizzled/version.h>                   
 
39
/* Lots of system-wide struct definitions like IO_CACHE, DYNAMIC_STRING, prototypes for all my_* functions */
 
40
#include <mysys/my_sys.h>                       
 
41
/* Convenience functions for working with times */
34
42
#include <libdrizzle/my_time.h>
 
43
/* Custom C string functions */
35
44
#include <mystrings/m_string.h>
 
45
/* Custom HASH API */
36
46
#include <mysys/hash.h>
 
47
/* Standard signals API */
37
48
#include <signal.h>
 
49
/* Deadlock-free table-list lock API */
38
50
#include <mysys/thr_lock.h>
 
51
/* Custom error API */
39
52
#include <drizzled/error.h>
 
53
/* Defines for the storage engine handler -- i.e. HA_XXX defines */
40
54
#include <drizzled/base.h>                                      /* Needed by field.h */
 
55
/* Custom queue API */
41
56
#include <mysys/queues.h>
42
 
#include <drizzled/sql_bitmap.h>                /* Custom bitmap API */
 
57
/* Custom Bitmap API */
 
58
#include <drizzled/sql_bitmap.h>
 
59
/* Custom templatized, type-safe Dynamic_Array API */
43
60
#include "sql_array.h"
 
61
/* The <strong>INTERNAL</strong> plugin API - not the external, or public, server plugin API */
44
62
#include "sql_plugin.h"
 
63
/* The <strong>connection</strong> thread scheduler API */
45
64
#include "scheduler.h"
 
65
/* Network database operations (hostent, netent, servent, etc...*/
 
66
#include <netdb.h>
 
67
/* Communication API between a client and the server */
 
68
#include <libdrizzle/drizzle_com.h>
46
69
 
47
70
#ifdef HAVE_DTRACE
48
71
#define _DTRACE_VERSION 1
49
72
#endif
50
73
#include "probes.h"
51
74
 
52
 
#include <netdb.h>
53
 
 
54
75
/**
55
76
  Query type constants.
56
77
 
57
78
  QT_ORDINARY -- ordinary SQL query.
58
79
  QT_IS -- SQL query to be shown in INFORMATION_SCHEMA (in utf8 and without
59
80
  character set introducers).
 
81
 
 
82
  @TODO
 
83
 
 
84
  Move this out of here once Stew's done with UDF breakout.  The following headers need it:
 
85
 
 
86
    sql_lex.h --> included by sql_class.h
 
87
    item.h
 
88
    table.h
 
89
    item_func.h
 
90
    item_subselect.h
 
91
    item_timefunc.h
 
92
    item_sum.h
 
93
    item_cmpfunc.h
 
94
    item_strfunc.h
60
95
*/
61
96
enum enum_query_type
62
97
{
64
99
  QT_IS
65
100
};
66
101
 
67
 
/* TODO convert all these three maps to Bitmap classes */
 
102
/** 
 
103
 * @TODO convert all these three maps to Bitmap classes 
 
104
 *
 
105
 * @TODO Move these to a more appropriate header file (maps.h?).  The following files use them:
 
106
 *
 
107
 *    item_sum.h
 
108
 *    item_compfunc.h
 
109
 *    item.h
 
110
 *    table.h
 
111
 *    item_subselect.h
 
112
 *    sql_bitmap.h
 
113
 *    unireg.h (going bye bye?)
 
114
 *    sql_udf.h
 
115
 *    item_row.h
 
116
 *    handler.cc
 
117
 *    sql_insert.cc
 
118
 *    opt_range.h
 
119
 *    opt_sum.cc
 
120
 *    item_strfunc.h
 
121
 *    sql_delete.cc
 
122
 *    sql_select.h
 
123
 *
 
124
 *    Since most of these include table.h, I think that would appropriate...
 
125
 */
68
126
typedef uint64_t table_map;          /* Used for table bits in join */
69
127
#if MAX_INDEXES <= 64
70
128
typedef Bitmap<64>  key_map;          /* Used for finding keys */
72
130
typedef Bitmap<((MAX_INDEXES+7)/8*8)> key_map; /* Used for finding keys */
73
131
#endif
74
132
typedef uint32_t nesting_map;  /* Used for flags of nesting constructs */
 
133
 
 
134
#include "unireg.h"
 
135
 
75
136
/*
76
137
  Used to identify NESTED_JOIN structures within a join (applicable only to
77
138
  structures that have not been simplified away and embed more the one
78
139
  element)
79
140
*/
80
 
typedef uint64_t nested_join_map;
81
 
 
82
 
/* query_id */
83
 
typedef uint64_t query_id_t;
84
 
extern query_id_t global_query_id;
85
 
 
86
 
/* increment query_id and return it.  */
87
 
inline query_id_t next_query_id() { return global_query_id++; }
88
 
 
89
 
/* useful constants */
 
141
typedef uint64_t nested_join_map; /* Needed by sql_select.h and table.h */
 
142
 
 
143
/* useful constants */#
90
144
extern const key_map key_map_empty;
91
145
extern key_map key_map_full;          /* Should be threaded as const */
92
146
extern const char *primary_key_name;
93
147
 
94
 
#include <libdrizzle/drizzle_com.h>
95
148
#include <vio/violite.h>
96
 
#include "unireg.h"
97
149
 
98
150
#include <drizzled/sql_alloc.h>
99
151
 
 
152
/**
 
153
 * @TODO Move the following into a drizzled.h header?
 
154
 *
 
155
 * I feel that global variables and functions referencing them directly
 
156
 * and that are used only in the server should be separated out into 
 
157
 * a drizzled.h header file -- JRP
 
158
 */
 
159
typedef uint64_t query_id_t;
 
160
extern query_id_t global_query_id;
 
161
 
 
162
/* increment query_id and return it.  */
 
163
inline query_id_t next_query_id() { return global_query_id++; }
 
164
 
100
165
#define PREV_BITS(type,A)       ((type) (((type) 1 << (A)) -1))
101
166
#define all_bits_set(A,B) ((A) & (B) != (B))
102
167