~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/structs.h

  • Committer: Olaf van der Spek
  • Date: 2011-02-12 18:24:24 UTC
  • mto: (2167.1.2 build) (2172.1.4 build)
  • mto: This revision was merged to the branch mainline in revision 2168.
  • Revision ID: olafvdspek@gmail.com-20110212182424-kgnm9osi7qo97at2
casts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
 
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
39
39
class Table;
40
40
class Field;
41
41
 
42
 
typedef struct st_keyfile_info {        /* used with ha_info() */
43
 
  unsigned char ref[MAX_REFLENGTH];             /* Pointer to current row */
44
 
  unsigned char dupp_ref[MAX_REFLENGTH];        /* Pointer to dupp row */
45
 
  uint32_t ref_length;                  /* Length of ref (1-8) */
46
 
  uint32_t block_size;                  /* index block size */
47
 
  int filenr;                           /* (uniq) filenr for table */
48
 
  ha_rows records;                      /* Records i datafilen */
49
 
  ha_rows deleted;                      /* Deleted records */
50
 
  uint64_t data_file_length;            /* Length off data file */
51
 
  uint64_t max_data_file_length;        /* Length off data file */
52
 
  uint64_t index_file_length;
53
 
  uint64_t max_index_file_length;
54
 
  uint64_t delete_length;               /* Free bytes */
55
 
  uint64_t auto_increment_value;
56
 
  int errkey,sortkey;                   /* Last errorkey and sorted by */
57
 
  time_t create_time;                   /* When table was created */
58
 
  time_t check_time;
59
 
  time_t update_time;
60
 
  uint64_t mean_rec_length;             /* physical reclength */
61
 
} KEYFILE_INFO;
62
 
 
63
 
 
64
 
typedef struct st_key_part_info {       /* Info about a key part */
 
42
class KeyPartInfo 
 
43
{       /* Info about a key part */
 
44
public:
65
45
  Field *field;
66
46
  unsigned int  offset;                         /* offset in record (from 0) */
67
47
  unsigned int  null_offset;                    /* Offset to null_bit in record */
77
57
  */
78
58
  uint16_t store_length;
79
59
  uint16_t key_type;
 
60
private:
 
61
public:
 
62
  uint16_t getKeyType() const
 
63
  {
 
64
    return key_type;
 
65
  }
80
66
  uint16_t fieldnr;                     /* Fieldnum in UNIREG (1,2,3,...) */
81
67
  uint16_t key_part_flag;                       /* 0 or HA_REVERSE_SORT */
82
68
  uint8_t type;
83
69
  uint8_t null_bit;                     /* Position to null_bit */
84
 
} KEY_PART_INFO ;
85
 
 
86
 
 
87
 
typedef struct st_key {
 
70
};
 
71
 
 
72
 
 
73
class KeyInfo 
 
74
{
 
75
public:
88
76
  unsigned int  key_length;             /* Tot length of key */
89
77
  enum  ha_key_alg algorithm;
90
78
  unsigned long flags;                  /* dupp key and pack flags */
92
80
  uint32_t  extra_length;
93
81
  unsigned int usable_key_parts;        /* Should normally be = key_parts */
94
82
  uint32_t  block_size;
95
 
  KEY_PART_INFO *key_part;
 
83
  KeyPartInfo *key_part;
96
84
  char  *name;                          /* Name of key */
97
85
  /*
98
86
    Array of AVG(#records with the same field value) for 1st ... Nth key part.
102
90
  ulong *rec_per_key;
103
91
  Table *table;
104
92
  LEX_STRING comment;
105
 
} KEY;
 
93
};
106
94
 
107
95
 
108
96
class JoinTable;
109
97
 
110
 
struct RegInfo {                /* Extra info about reg */
 
98
class RegInfo 
 
99
{
 
100
public:         /* Extra info about reg */
111
101
  JoinTable *join_tab;  /* Used by SELECT() */
112
102
  enum thr_lock_type lock_type;         /* How database is used */
113
103
  bool not_exists_optimize;
124
114
  }
125
115
};
126
116
 
127
 
struct st_read_record;                          /* For referense later */
128
117
class Session;
129
118
class Cursor;
130
119
namespace optimizer { class SqlSelect; }
131
120
 
132
 
typedef struct st_read_record {                 /* Parameter to read_record */
133
 
  Table *table;                 /* Head-form */
134
 
  Cursor *cursor;
135
 
  Table **forms;                        /* head and ref forms */
136
 
  int (*read_record)(struct st_read_record *);
137
 
  Session *session;
138
 
  optimizer::SqlSelect *select;
139
 
  uint32_t cache_records;
140
 
  uint32_t ref_length,struct_length,reclength,rec_cache_size,error_offset;
141
 
  uint32_t index;
142
 
  unsigned char *ref_pos;                               /* pointer to form->refpos */
143
 
  unsigned char *record;
144
 
  unsigned char *rec_buf;                /* to read field values  after filesort */
145
 
  unsigned char *cache,*cache_pos,*cache_end,*read_positions;
146
 
  internal::IO_CACHE *io_cache;
147
 
  bool print_error, ignore_not_found_rows;
148
 
  JoinTable *do_insideout_scan;
149
 
} READ_RECORD;
150
 
 
151
121
typedef int *(*update_var)(Session *, struct drizzle_show_var *);
152
122
 
153
123
} /* namespace drizzled */