1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems, Inc.
4
* Copyright (C) 2008 Sun Microsystems
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
23
23
#ifndef DRIZZLED_STRUCTS_H
24
24
#define DRIZZLED_STRUCTS_H
26
#include "drizzled/base.h"
27
#include "drizzled/definitions.h"
28
#include "drizzled/lex_string.h"
29
#include "drizzled/thr_lock.h"
36
typedef struct st_io_cache IO_CACHE;
26
#include <drizzled/base.h>
27
#include <mysys/definitions.h>
28
#include <drizzled/lex_string.h>
43
{ /* Info about a key part */
32
typedef struct st_io_cache IO_CACHE;
34
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 */
39
File filenr; /* (uniq) filenr for table */
40
ha_rows records; /* Records i datafilen */
41
ha_rows deleted; /* Deleted records */
42
uint64_t data_file_length; /* Length off data file */
43
uint64_t max_data_file_length; /* Length off data file */
44
uint64_t index_file_length;
45
uint64_t max_index_file_length;
46
uint64_t delete_length; /* Free bytes */
47
uint64_t auto_increment_value;
48
int errkey,sortkey; /* Last errorkey and sorted by */
49
time_t create_time; /* When table was created */
52
uint64_t mean_rec_length; /* physical reclength */
56
typedef struct st_key_part_info { /* Info about a key part */
46
unsigned int offset; /* offset in record (from 0) */
47
unsigned int null_offset; /* Offset to null_bit in record */
58
uint offset; /* offset in record (from 0) */
59
uint null_offset; /* Offset to null_bit in record */
48
60
/* Length of key part in bytes, excluding NULL flag and length bytes */
58
70
uint16_t store_length;
62
uint16_t getKeyType() const
66
72
uint16_t fieldnr; /* Fieldnum in UNIREG (1,2,3,...) */
67
73
uint16_t key_part_flag; /* 0 or HA_REVERSE_SORT */
69
75
uint8_t null_bit; /* Position to null_bit */
76
unsigned int key_length; /* Tot length of key */
79
typedef struct st_key {
80
uint key_length; /* Tot length of key */
77
81
enum ha_key_alg algorithm;
78
unsigned long flags; /* dupp key and pack flags */
79
unsigned int key_parts; /* How many key_parts */
82
ulong flags; /* dupp key and pack flags */
83
uint key_parts; /* How many key_parts */
80
84
uint32_t extra_length;
81
unsigned int usable_key_parts; /* Should normally be = key_parts */
85
uint usable_key_parts; /* Should normally be = key_parts */
82
86
uint32_t block_size;
83
KeyPartInfo *key_part;
87
KEY_PART_INFO *key_part;
84
88
char *name; /* Name of key */
86
90
Array of AVG(#records with the same field value) for 1st ... Nth key part.
90
94
ulong *rec_per_key;
92
96
LEX_STRING comment;
100
public: /* Extra info about reg */
102
struct RegInfo { /* Extra info about reg */
101
103
JoinTable *join_tab; /* Used by SELECT() */
102
104
enum thr_lock_type lock_type; /* How database is used */
103
105
bool not_exists_optimize;
119
struct st_read_record; /* For referense later */
119
namespace optimizer { class SqlSelect; }
121
typedef int *(*update_var)(Session *, struct drizzle_show_var *);
123
} /* namespace drizzled */
124
typedef struct st_read_record { /* Parameter to read_record */
125
Table *table; /* Head-form */
127
Table **forms; /* head and ref forms */
128
int (*read_record)(struct st_read_record *);
131
uint32_t cache_records;
132
uint32_t ref_length,struct_length,reclength,rec_cache_size,error_offset;
134
unsigned char *ref_pos; /* pointer to form->refpos */
135
unsigned char *record;
136
unsigned char *rec_buf; /* to read field values after filesort */
137
unsigned char *cache,*cache_pos,*cache_end,*read_positions;
139
bool print_error, ignore_not_found_rows;
140
JoinTable *do_insideout_scan;
143
extern const char *show_comp_option_name[];
145
typedef int *(*update_var)(Session *, struct st_mysql_show_var *);
125
147
/* Bits in form->status */
126
148
#define STATUS_NO_RECORD (1+2) /* Record isn't usably */