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/structs.h>
00036 #include <drizzled/util/data_ref.h>
00037 
00038 namespace drizzled {
00039 
00040 typedef struct st_ha_create_information
00041 {
00042   const charset_info_st *table_charset, *default_table_charset;
00043   const char *alias;
00044   uint64_t auto_increment_value;
00045   uint32_t table_options;
00046   uint32_t used_fields;
00047   plugin::StorageEngine *db_type;
00048   bool table_existed;     /* 1 in create if table existed */
00049 
00050   st_ha_create_information() :
00051     table_charset(0),
00052     default_table_charset(0),
00053     alias(0),
00054     auto_increment_value(0),
00055     table_options(0),
00056     used_fields(0),
00057     db_type(0),
00058     table_existed(0)
00059   { }
00060 } HA_CREATE_INFO;
00061 
00062 typedef struct st_ha_alter_information
00063 {
00064   KeyInfo  *key_info_buffer;
00065   uint32_t key_count;
00066   uint32_t index_drop_count;
00067   uint32_t *index_drop_buffer;
00068   uint32_t index_add_count;
00069   uint32_t *index_add_buffer;
00070   void *data;
00071 
00072   st_ha_alter_information() :
00073     key_info_buffer(0),
00074     key_count(0),
00075     index_drop_count(0),
00076     index_drop_buffer(0),
00077     index_add_count(0),
00078     index_add_buffer(0),
00079     data(0)
00080   { }
00081 
00082 } HA_ALTER_INFO;
00083 
00084 
00085 struct KEY_CREATE_INFO
00086 {
00087   KEY_CREATE_INFO() :
00088     algorithm(HA_KEY_ALG_UNDEF),
00089     block_size(0)
00090   {
00091   }
00092 
00093   ha_key_alg algorithm;
00094   uint32_t block_size;
00095   str_ref comment;
00096 };
00097 
00098 
00099 typedef struct st_range_seq_if
00100 {
00101   /*
00102     Initialize the traversal of range sequence
00103 
00104     SYNOPSIS
00105     init()
00106     init_params  The seq_init_param parameter
00107     n_ranges     The number of ranges obtained
00108     flags        A combination of HA_MRR_SINGLE_POINT, HA_MRR_FIXED_KEY
00109 
00110     RETURN
00111     An opaque value to be used as RANGE_SEQ_IF::next() parameter
00112   */
00113   range_seq_t (*init)(void *init_params, uint32_t n_ranges, uint32_t flags);
00114 
00115 
00116   /*
00117     Get the next range in the range sequence
00118 
00119     SYNOPSIS
00120     next()
00121     seq    The value returned by RANGE_SEQ_IF::init()
00122     range  OUT Information about the next range
00123 
00124     RETURN
00125     0 - Ok, the range structure filled with info about the next range
00126     1 - No more ranges
00127   */
00128   uint32_t (*next) (range_seq_t seq, KEY_MULTI_RANGE *range);
00129 } RANGE_SEQ_IF;
00130 
00131 } /* namespace drizzled */
00132