Drizzled Public API Documentation

tmp_table_param.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 
00021 #pragma once
00022 
00023 #include <plugin/myisam/myisam.h>
00024 
00025 namespace drizzled {
00026 
00027 /*
00028   Param to create temporary tables when doing SELECT:s
00029   NOTE
00030     This structure is copied using memcpy as a part of JOIN.
00031 */
00032 
00033 class Tmp_Table_Param : public memory::SqlAlloc, boost::noncopyable
00034 {
00035 public:
00036   KeyInfo *keyinfo;
00037   List<Item> copy_funcs;
00038   List<Item> save_copy_funcs;
00039   CopyField *copy_field, *copy_field_end;
00040   CopyField *save_copy_field, *save_copy_field_end;
00041   unsigned char     *group_buff;
00042   Item      **items_to_copy;      /* Fields in tmp table */
00043   MI_COLUMNDEF *recinfo,*start_recinfo;
00044   ha_rows end_write_records;
00045   uint32_t  field_count;
00046   uint32_t  sum_func_count;
00047   uint32_t  func_count;
00048   uint32_t  hidden_field_count;
00049   uint32_t  group_parts,group_length,group_null_parts;
00050   uint32_t  quick_group;
00051   bool using_indirect_summary_function;
00052   bool schema_table;
00053 
00054   /*
00055     True if GROUP BY and its aggregate functions are already computed
00056     by a table access method (e.g. by loose index scan). In this case
00057     query execution should not perform aggregation and should treat
00058     aggregate functions as normal functions.
00059   */
00060   bool precomputed_group_by;
00061 
00062   bool force_copy_fields;
00063 
00064   /* If >0 convert all blob fields to varchar(convert_blob_length) */
00065   uint32_t  convert_blob_length;
00066 
00067   const charset_info_st *table_charset;
00068 
00069   Tmp_Table_Param() :
00070     keyinfo(0),
00071     copy_funcs(),
00072     save_copy_funcs(),
00073     copy_field(0),
00074     copy_field_end(0),
00075     save_copy_field(0),
00076     save_copy_field_end(0),
00077     group_buff(0),
00078     items_to_copy(0),
00079     recinfo(0),
00080     start_recinfo(0),
00081     end_write_records(0),
00082     field_count(0),
00083     sum_func_count(0),
00084     func_count(0),
00085     hidden_field_count(0),
00086     group_parts(0),
00087     group_length(0),
00088     group_null_parts(0),
00089     quick_group(0),
00090     using_indirect_summary_function(false),
00091     schema_table(false),
00092     precomputed_group_by(false),
00093     force_copy_fields(false),
00094     convert_blob_length(0),
00095     table_charset(0)
00096   {}
00097 
00098   ~Tmp_Table_Param()
00099   {
00100     cleanup();
00101   }
00102   void init(void);
00103   void cleanup(void);
00104 };
00105 
00106 } /* namespace drizzled */
00107