Drizzled Public API Documentation

handler_structs.h
00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2008 Sun Microsystems, Inc.
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; version 2 of the License.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018  */
00019 
00020 #pragma once
00021 
00022 #if TIME_WITH_SYS_TIME
00023 # include <sys/time.h>
00024 # include <time.h>
00025 #else
00026 # if HAVE_SYS_TIME_H
00027 #  include <sys/time.h>
00028 # else
00029 #  include <time.h>
00030 # endif
00031 #endif
00032 
00033 #include <drizzled/base.h>
00034 #include <drizzled/definitions.h>
00035 #include <drizzled/lex_string.h>
00036 #include <drizzled/structs.h>
00037 
00038 namespace drizzled
00039 {
00040 
00041 struct charset_info_st;
00042 
00043 namespace plugin
00044 {
00045 class StorageEngine;
00046 }
00047 
00048 typedef struct st_ha_create_information
00049 {
00050   const charset_info_st *table_charset, *default_table_charset;
00051   const char *alias;
00052   uint64_t auto_increment_value;
00053   uint32_t table_options;
00054   uint32_t used_fields;
00055   plugin::StorageEngine *db_type;
00056   bool table_existed;     /* 1 in create if table existed */
00057 
00058   st_ha_create_information() :
00059     table_charset(0),
00060     default_table_charset(0),
00061     alias(0),
00062     auto_increment_value(0),
00063     table_options(0),
00064     used_fields(0),
00065     db_type(0),
00066     table_existed(0)
00067   { }
00068 } HA_CREATE_INFO;
00069 
00070 typedef struct st_ha_alter_information
00071 {
00072   KeyInfo  *key_info_buffer;
00073   uint32_t key_count;
00074   uint32_t index_drop_count;
00075   uint32_t *index_drop_buffer;
00076   uint32_t index_add_count;
00077   uint32_t *index_add_buffer;
00078   void *data;
00079 
00080   st_ha_alter_information() :
00081     key_info_buffer(0),
00082     key_count(0),
00083     index_drop_count(0),
00084     index_drop_buffer(0),
00085     index_add_count(0),
00086     index_add_buffer(0),
00087     data(0)
00088   { }
00089 
00090 } HA_ALTER_INFO;
00091 
00092 
00093 typedef struct key_create_information_st
00094 {
00095   enum ha_key_alg algorithm;
00096   uint32_t block_size;
00097   LEX_STRING comment;
00098 } KEY_CREATE_INFO;
00099 
00100 
00101 typedef struct st_ha_check_opt
00102 {
00103   st_ha_check_opt() {}                        /* Remove gcc warning */
00104 } HA_CHECK_OPT;
00105 
00106 
00107 typedef struct st_range_seq_if
00108 {
00109   /*
00110     Initialize the traversal of range sequence
00111 
00112     SYNOPSIS
00113     init()
00114     init_params  The seq_init_param parameter
00115     n_ranges     The number of ranges obtained
00116     flags        A combination of HA_MRR_SINGLE_POINT, HA_MRR_FIXED_KEY
00117 
00118     RETURN
00119     An opaque value to be used as RANGE_SEQ_IF::next() parameter
00120   */
00121   range_seq_t (*init)(void *init_params, uint32_t n_ranges, uint32_t flags);
00122 
00123 
00124   /*
00125     Get the next range in the range sequence
00126 
00127     SYNOPSIS
00128     next()
00129     seq    The value returned by RANGE_SEQ_IF::init()
00130     range  OUT Information about the next range
00131 
00132     RETURN
00133     0 - Ok, the range structure filled with info about the next range
00134     1 - No more ranges
00135   */
00136   uint32_t (*next) (range_seq_t seq, KEY_MULTI_RANGE *range);
00137 } RANGE_SEQ_IF;
00138 
00139 } /* namespace drizzled */
00140