~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/drizzle_com.h

Merged from Jay.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#ifndef _libdrizzle_drizzle_com_h
26
26
#define _libdrizzle_drizzle_com_h
27
27
 
 
28
/*
 
29
   This is included in the server and in the client.
 
30
   Options for select set by the yacc parser (stored in lex->options).
 
31
 
 
32
   XXX:
 
33
   log_event.h defines OPTIONS_WRITTEN_TO_BIN_LOG to specify what THD
 
34
   options list are written into binlog. These options can NOT change their
 
35
   values, or it will break replication between version.
 
36
 
 
37
   context is encoded as following:
 
38
   SELECT - SELECT_LEX_NODE::options
 
39
   THD    - THD::options
 
40
   intern - neither. used only as
 
41
            func(..., select_node->options | thd->options | OPTION_XXX, ...)
 
42
 
 
43
   TODO: separate three contexts above, move them to separate bitfields.
 
44
*/
 
45
 
 
46
#define SELECT_DISTINCT         (1ULL << 0)     // SELECT, user
 
47
#define SELECT_STRAIGHT_JOIN    (1ULL << 1)     // SELECT, user
 
48
#define SELECT_DESCRIBE         (1ULL << 2)     // SELECT, user
 
49
#define SELECT_SMALL_RESULT     (1ULL << 3)     // SELECT, user
 
50
#define SELECT_BIG_RESULT       (1ULL << 4)     // SELECT, user
 
51
#define OPTION_FOUND_ROWS       (1ULL << 5)     // SELECT, user
 
52
#define SELECT_NO_JOIN_CACHE    (1ULL << 7)     // intern
 
53
#define OPTION_BIG_TABLES       (1ULL << 8)     // THD, user
 
54
#define OPTION_BIG_SELECTS      (1ULL << 9)     // THD, user
 
55
#define OPTION_LOG_OFF          (1ULL << 10)    // THD, user
 
56
#define OPTION_QUOTE_SHOW_CREATE (1ULL << 11)   // THD, user, unused
 
57
#define TMP_TABLE_ALL_COLUMNS   (1ULL << 12)    // SELECT, intern
 
58
#define OPTION_WARNINGS         (1ULL << 13)    // THD, user
 
59
#define OPTION_AUTO_IS_NULL     (1ULL << 14)    // THD, user, binlog
 
60
#define OPTION_FOUND_COMMENT    (1ULL << 15)    // SELECT, intern, parser
 
61
#define OPTION_SAFE_UPDATES     (1ULL << 16)    // THD, user
 
62
#define OPTION_BUFFER_RESULT    (1ULL << 17)    // SELECT, user
 
63
#define OPTION_BIN_LOG          (1ULL << 18)    // THD, user
 
64
#define OPTION_NOT_AUTOCOMMIT   (1ULL << 19)    // THD, user
 
65
#define OPTION_BEGIN            (1ULL << 20)    // THD, intern
 
66
#define OPTION_TABLE_LOCK       (1ULL << 21)    // THD, intern
 
67
#define OPTION_QUICK            (1ULL << 22)    // SELECT (for DELETE)
 
68
#define OPTION_KEEP_LOG         (1ULL << 23)    // THD, user
 
69
 
 
70
/* The following is used to detect a conflict with DISTINCT */
 
71
#define SELECT_ALL              (1ULL << 24)    // SELECT, user, parser
 
72
 
 
73
/** The following can be set when importing tables in a 'wrong order'
 
74
   to suppress foreign key checks */
 
75
#define OPTION_NO_FOREIGN_KEY_CHECKS    (1ULL << 26) // THD, user, binlog
 
76
/** The following speeds up inserts to InnoDB tables by suppressing unique
 
77
   key checks in some cases */
 
78
#define OPTION_RELAXED_UNIQUE_CHECKS    (1ULL << 27) // THD, user, binlog
 
79
#define SELECT_NO_UNLOCK                (1ULL << 28) // SELECT, intern
 
80
#define OPTION_SCHEMA_TABLE             (1ULL << 29) // SELECT, intern
 
81
/** Flag set if setup_tables already done */
 
82
#define OPTION_SETUP_TABLES_DONE        (1ULL << 30) // intern
 
83
/** If not set then the thread will ignore all warnings with level notes. */
 
84
#define OPTION_SQL_NOTES                (1ULL << 31) // THD, user
 
85
/**
 
86
  Force the used temporary table to be a MyISAM table (because we will use
 
87
  fulltext functions when reading from it.
 
88
*/
 
89
#define TMP_TABLE_FORCE_MYISAM          (1ULL << 32)
 
90
#define OPTION_PROFILING                (1ULL << 33)
 
91
 
 
92
/*
 
93
  Dont report errors for individual rows,
 
94
  But just report error on commit (or read ofcourse)
 
95
*/
 
96
#define OPTION_ALLOW_BATCH              (1ULL << 33) // THD, intern (slave)
 
97
 
 
98
/**
 
99
  Maximum length of time zone name that we support
 
100
  (Time zone name is char(64) in db). mysqlbinlog needs it.
 
101
*/
 
102
#define MAX_TIME_ZONE_NAME_LENGTH       (NAME_LEN + 1)
 
103
 
28
104
#define HOSTNAME_LENGTH 60
29
105
#define SYSTEM_CHARSET_MBMAXLEN 4
30
106
#define NAME_CHAR_LEN   64              /* Field/table name length */
354
430
int32_t net_real_write(NET *net,const unsigned char *packet, size_t len);
355
431
uint32_t my_net_read(NET *net);
356
432
 
357
 
#ifdef _global_h
 
433
 
 
434
/** @TODO global.h is actually not needed here... only stdint and protocol.h */
 
435
#ifdef DRIZZLE_SERVER_GLOBAL_H
358
436
void my_net_set_write_timeout(NET *net, uint timeout);
359
437
void my_net_set_read_timeout(NET *net, uint timeout);
360
438
#endif
439
517
char *get_tty_password(const char *opt_message);
440
518
const char *drizzle_errno_to_sqlstate(unsigned int drizzle_errno);
441
519
 
442
 
 
443
 
#ifdef _global_h
 
520
/** @TODO Is it necessary to include all of drizzled/global.h here? */
 
521
#ifdef DRIZZLE_SERVER_GLOBAL_H
444
522
ulong STDCALL net_field_length(uchar **packet);
445
523
uint64_t net_field_length_ll(uchar **packet);
446
524
uchar *net_store_length(uchar *pkg, uint64_t length);