~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/common.h

merge latest dev work

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include <stdint.h>
29
29
#include <drizzled/korr.h>
30
30
 
 
31
#if !defined(__cplusplus)
 
32
# include <stdbool.h>
 
33
#endif
 
34
 
31
35
/*
32
36
   This is included in the server and in the client.
33
37
   Options for select set by the yacc parser (stored in lex->options).
119
123
#define COLUMN_COMMENT_MAXLEN 1024
120
124
#define INDEX_COMMENT_MAXLEN 1024
121
125
 
 
126
/* The length of the header part for each virtual column in the .frm file. */
 
127
#define FRM_VCOL_HEADER_SIZE 3
 
128
/*
 
129
  Maximum length of the expression statement defined for virtual columns.
 
130
*/
 
131
#define VIRTUAL_COLUMN_EXPRESSION_MAXLEN 255 - FRM_VCOL_HEADER_SIZE
 
132
 
122
133
/*
123
134
  USER_HOST_BUFF_SIZE -- length of string buffer, that is enough to contain
124
135
  username and hostname parts of the user identifier with trailing zero in
137
148
 
138
149
enum enum_server_command
139
150
{
140
 
  COM_SLEEP,
141
 
  COM_QUIT,
142
 
  COM_INIT_DB,
143
 
  COM_QUERY,
144
 
  COM_SHUTDOWN,
145
 
  COM_CONNECT,
146
 
  COM_PING,
 
151
  COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST,
 
152
  COM_CREATE_DB, COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN,
 
153
  COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_PING,
 
154
  COM_TIME, COM_CHANGE_USER,
 
155
  COM_CONNECT_OUT,
 
156
  COM_SET_OPTION, COM_DAEMON,
147
157
  /* don't forget to update const char *command_name[] in sql_parse.cc */
 
158
 
148
159
  /* Must be last */
149
160
  COM_END
150
161
};
189
200
#define FIELD_STORAGE_FLAGS 22          /* Storage type: bit 22, 23 and 24 */
190
201
#define COLUMN_FORMAT_FLAGS 25          /* Column format: bit 25, 26 and 27 */
191
202
 
 
203
#define REFRESH_GRANT           1       /* Refresh grant tables */
192
204
#define REFRESH_LOG             2       /* Start on new log file */
193
205
#define REFRESH_TABLES          4       /* close all tables */
 
206
#define REFRESH_HOSTS           8       /* Flush host cache */
194
207
#define REFRESH_STATUS          16      /* Flush status variables */
195
208
 
196
209
/* The following can't be set with mysql_refresh() */
204
217
#define CLIENT_NO_SCHEMA        16      /* Don't allow database.table.column */
205
218
#define CLIENT_COMPRESS         32      /* Can use compression protocol */
206
219
#define CLIENT_ODBC             64      /* Odbc client */
 
220
#define CLIENT_LOCAL_FILES      128     /* Can use LOAD DATA LOCAL */
207
221
#define CLIENT_IGNORE_SPACE     256     /* Ignore spaces before '(' */
208
222
#define UNUSED_CLIENT_PROTOCOL_41       512     /* New 4.1 protocol */
 
223
#define CLIENT_INTERACTIVE      1024    /* This is an interactive client */
209
224
#define CLIENT_SSL              2048    /* Switch to SSL after handshake */
210
225
#define CLIENT_IGNORE_SIGPIPE   4096    /* IGNORE sigpipes */
 
226
#define CLIENT_TRANSACTIONS     8192    /* Client knows about transactions */
211
227
#define CLIENT_RESERVED         16384   /* Old flag for 4.1 protocol  */
212
228
#define CLIENT_SECURE_CONNECTION 32768  /* New 4.1 authentication */
213
229
#define CLIENT_MULTI_STATEMENTS (1UL << 16) /* Enable/disable multi-stmt support */
224
240
                           CLIENT_NO_SCHEMA | \
225
241
                           CLIENT_COMPRESS | \
226
242
                           CLIENT_ODBC | \
 
243
                           CLIENT_LOCAL_FILES | \
227
244
                           CLIENT_IGNORE_SPACE | \
 
245
                           CLIENT_INTERACTIVE | \
228
246
                           CLIENT_SSL | \
229
247
                           CLIENT_IGNORE_SIGPIPE | \
 
248
                           CLIENT_TRANSACTIONS | \
230
249
                           CLIENT_RESERVED | \
231
250
                           CLIENT_SECURE_CONNECTION | \
232
251
                           CLIENT_MULTI_STATEMENTS | \
281
300
#define MAX_INT_WIDTH           10      /* Max width for a LONG w.o. sign */
282
301
#define MAX_BIGINT_WIDTH        20      /* Max width for a LONGLONG */
283
302
#define MAX_CHAR_WIDTH          255     /* Max length for a CHAR colum */
284
 
#define MAX_BLOB_WIDTH          (uint32_t)16777216      /* Default width for blob */
 
303
#define MAX_BLOB_WIDTH          16777216        /* Default width for blob */
285
304
 
286
305
#define DRIZZLE_PROTOCOL_NO_MORE_DATA 0xFE
287
306
 
309
328
                        DRIZZLE_TYPE_DATETIME,
310
329
                        DRIZZLE_TYPE_DATE,
311
330
                        DRIZZLE_TYPE_VARCHAR,
 
331
                        DRIZZLE_TYPE_VIRTUAL,
312
332
                        DRIZZLE_TYPE_NEWDECIMAL,
313
333
                        DRIZZLE_TYPE_ENUM,
314
334
                        DRIZZLE_TYPE_BLOB,
316
336
};
317
337
 
318
338
 
 
339
enum enum_cursor_type
 
340
{
 
341
  CURSOR_TYPE_NO_CURSOR= 0,
 
342
  CURSOR_TYPE_READ_ONLY= 1,
 
343
  CURSOR_TYPE_FOR_UPDATE= 2,
 
344
  CURSOR_TYPE_SCROLLABLE= 4
 
345
};
 
346
 
 
347
 
 
348
/* options for mysql_set_option */
 
349
enum enum_drizzle_set_option
 
350
{
 
351
  DRIZZLE_OPTION_MULTI_STATEMENTS_ON,
 
352
  DRIZZLE_OPTION_MULTI_STATEMENTS_OFF
 
353
};
 
354
 
 
355
#define net_new_transaction(net) ((net)->pkt_nr=0)
 
356
 
 
357
 
319
358
  /* The following is for user defined functions */
320
359
 
321
360
enum Item_result {STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT,
353
392
#define NET_HEADER_SIZE 4               /* standard header size */
354
393
#define COMP_HEADER_SIZE 3              /* compression header extra size */
355
394
 
 
395
 
 
396
#define NULL_LENGTH UINT32_MAX /* For drizzleclient_net_store_length */
 
397
 
356
398
#endif