~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/structs.h

  • Committer: Brian Aker
  • Date: 2008-08-12 03:12:57 UTC
  • Revision ID: brian@tangent.org-20080812031257-ln3uk87y1r22byeg
First pass of new sql_db.cc work

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
5
 
 *
6
 
 *  This program is free software; you can redistribute it and/or modify
7
 
 *  it under the terms of the GNU General Public License as published by
8
 
 *  the Free Software Foundation; either version 2 of the License, or
9
 
 *  (at your option) any later version.
10
 
 *
11
 
 *  This program is distributed in the hope that it will be useful,
12
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 *  GNU General Public License for more details.
15
 
 *
16
 
 *  You should have received a copy of the GNU General Public License
17
 
 *  along with this program; if not, write to the Free Software
18
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 
 */
 
1
/* Copyright (C) 2000-2006 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
20
16
 
21
17
/* The old structures from unireg */
22
18
 
23
 
class Table;
 
19
 
 
20
#ifdef FOO
 
21
#undef _STDINT_H
 
22
#define __STDC_LIMIT_MACROS
 
23
#include <stdint.h>
 
24
#endif
 
25
 
 
26
struct st_table;
24
27
class Field;
25
28
 
26
29
typedef struct st_date_time_format {
27
 
  unsigned char positions[8];
 
30
  uchar positions[8];
28
31
  char  time_separator;                 /* Separator between hour and minute */
29
 
  uint32_t flag;                                /* For future */
 
32
  uint flag;                            /* For future */
30
33
  LEX_STRING format;
31
34
} DATE_TIME_FORMAT;
32
35
 
33
36
 
34
37
typedef struct st_keyfile_info {        /* used with ha_info() */
35
 
  unsigned char ref[MAX_REFLENGTH];             /* Pointer to current row */
36
 
  unsigned char dupp_ref[MAX_REFLENGTH];        /* Pointer to dupp row */
37
 
  uint32_t ref_length;                  /* Length of ref (1-8) */
38
 
  uint32_t block_size;                  /* index block size */
 
38
  uchar ref[MAX_REFLENGTH];             /* Pointer to current row */
 
39
  uchar dupp_ref[MAX_REFLENGTH];        /* Pointer to dupp row */
 
40
  uint ref_length;                      /* Length of ref (1-8) */
 
41
  uint block_size;                      /* index block size */
39
42
  File filenr;                          /* (uniq) filenr for table */
40
43
  ha_rows records;                      /* Records i datafilen */
41
44
  ha_rows deleted;                      /* Deleted records */
80
83
  uint  key_length;                     /* Tot length of key */
81
84
  ulong flags;                          /* dupp key and pack flags */
82
85
  uint  key_parts;                      /* How many key_parts */
83
 
  uint32_t  extra_length;
 
86
  uint  extra_length;
84
87
  uint  usable_key_parts;               /* Should normally be = key_parts */
85
 
  uint32_t  block_size;
 
88
  uint  block_size;
86
89
  enum  ha_key_alg algorithm;
87
90
  KEY_PART_INFO *key_part;
88
91
  char  *name;                          /* Name of key */
92
95
    For temporary heap tables this member is NULL.
93
96
  */
94
97
  ulong *rec_per_key;
95
 
  Table *table;
 
98
  struct st_table *table;
96
99
  LEX_STRING comment;
97
100
} KEY;
98
101
 
114
117
struct st_join_table;
115
118
 
116
119
typedef struct st_read_record {                 /* Parameter to read_record */
117
 
  Table *table;                 /* Head-form */
 
120
  struct st_table *table;                       /* Head-form */
118
121
  handler *file;
119
 
  Table **forms;                        /* head and ref forms */
 
122
  struct st_table **forms;                      /* head and ref forms */
120
123
  int (*read_record)(struct st_read_record *);
121
124
  THD *thd;
122
125
  SQL_SELECT *select;
123
 
  uint32_t cache_records;
124
 
  uint32_t ref_length,struct_length,reclength,rec_cache_size,error_offset;
125
 
  uint32_t index;
126
 
  unsigned char *ref_pos;                               /* pointer to form->refpos */
127
 
  unsigned char *record;
128
 
  unsigned char *rec_buf;                /* to read field values  after filesort */
129
 
  unsigned char *cache,*cache_pos,*cache_end,*read_positions;
 
126
  uint cache_records;
 
127
  uint ref_length,struct_length,reclength,rec_cache_size,error_offset;
 
128
  uint index;
 
129
  uchar *ref_pos;                               /* pointer to form->refpos */
 
130
  uchar *record;
 
131
  uchar *rec_buf;                /* to read field values  after filesort */
 
132
  uchar *cache,*cache_pos,*cache_end,*read_positions;
130
133
  IO_CACHE *io_cache;
131
134
  bool print_error, ignore_not_found_rows;
132
135
  struct st_join_table *do_insideout_scan;
133
136
} READ_RECORD;
134
137
 
135
138
 
 
139
/*
 
140
  Originally MySQL used DRIZZLE_TIME structure inside server only, but since
 
141
  4.1 it's exported to user in the new client API. Define aliases for
 
142
  new names to keep existing code simple.
 
143
*/
 
144
 
 
145
typedef enum enum_drizzle_timestamp_type timestamp_type;
 
146
 
 
147
 
136
148
typedef struct {
137
149
  ulong year,month,day,hour;
138
150
  uint64_t minute,second,second_part;
164
176
*/
165
177
typedef struct user_resources {
166
178
  /* Maximum number of queries/statements per hour. */
167
 
  uint32_t questions;
 
179
  uint questions;
168
180
  /*
169
181
     Maximum number of updating statements per hour (which statements are
170
182
     updating is defined by sql_command_flags array).
171
183
  */
172
 
  uint32_t updates;
 
184
  uint updates;
173
185
  /* Maximum number of connections established per hour. */
174
 
  uint32_t conn_per_hour;
 
186
  uint conn_per_hour;
175
187
  /* Maximum number of concurrent connections. */
176
 
  uint32_t user_conn;
 
188
  uint user_conn;
177
189
  /*
178
190
     Values of this enum and specified_limits member are used by the
179
191
     parser to store which user limits were specified in GRANT statement.
180
192
  */
181
193
  enum {QUERIES_PER_HOUR= 1, UPDATES_PER_HOUR= 2, CONNECTIONS_PER_HOUR= 4,
182
194
        USER_CONNECTIONS= 8};
183
 
  uint32_t specified_limits;
 
195
  uint specified_limits;
184
196
} USER_RESOURCES;
185
197
 
186
198
 
204
216
  */
205
217
  uint64_t reset_utime;
206
218
  /* Total length of the key. */
207
 
  uint32_t len;
 
219
  uint len;
208
220
  /* Current amount of concurrent connections for this account. */
209
 
  uint32_t connections;
 
221
  uint connections;
210
222
  /*
211
223
     Current number of connections per hour, number of updating statements
212
224
     per hour and total number of statements per hour for this account.
213
225
  */
214
 
  uint32_t conn_per_hour, updates, questions;
 
226
  uint conn_per_hour, updates, questions;
215
227
  /* Maximum amount of resources which account is allowed to consume. */
216
228
  USER_RESOURCES user_resources;
217
229
} USER_CONN;
302
314
    "head" to "tail" then to NULL).
303
315
  */
304
316
  Discrete_interval        *current;
305
 
  uint32_t                  elements; // number of elements
 
317
  uint                  elements; // number of elements
306
318
 
307
319
  /* helper function for copy construct and assignment operator */
308
320
  void copy_(const Discrete_intervals_list& from)
352
364
  bool append(Discrete_interval *interval);
353
365
  uint64_t minimum()     const { return (head ? head->minimum() : 0); };
354
366
  uint64_t maximum()     const { return (head ? tail->maximum() : 0); };
355
 
  uint32_t      nb_elements() const { return elements; }
 
367
  uint      nb_elements() const { return elements; }
356
368
};